Hi All
I am trying to use javascript in my perlCGI version. I would like to bring up a popup box, to check the value entered in one of the textfield when the user clicks the submit button.
I have given what I have done so far. What I need to do is either refresh the page/return to the same page when the user clicks cancel in the popupbox and continue with the process when said OK.
sub write_form{
my $additional_html = shift;
$additional_html ||='';
print $dw->header({'menu' => 1,
'script' => "function check_name() {
var sname;
var r;
sname = document.main.snp.value;
confirm(sname) ;
}" });
print $additional_html;
print $cgi->br();
print $cgi->h4('Register TaqMan Assay');
print $cgi->br();
print $cgi->start_form({-name =>'main',
-method =>'post',
-action =>'/cgi-bin/prodsoft/Genotyping/register_taqma
+n_new.pl',
-onSubmit=>'return check_name()'});
}
Could you drop in any suggestions on i) how could we check the cancel clicked and return the same page or refresh the page? ii) instead of checking when 'clicking the submit' is there any other way to check them before ?
thanks
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.