I've a question regarding the reading of form submission. The html form in question is as follows:
If the user clicks on the submit button 'doit', the submission is registered as desired. The value of the pwd field value is processed in the login sub.<form name="myform" action="lgoin.pl" method="post"> <table <tr><th align="center" colspan="2">Login</th> <tr><td>Password</td><td><input type="text" name="pwd" size="5"> +</td></tr> <tr><td align="center" colspan="2"><input type="submit" name="lo +gin" value="doit"></td></tr> </table> </form> # portions of cgi code my $doit = param('login'); my %functions = ('login' => \&do_login, 'logout' => \&do_logout, ); if defined($doit) { &{ $functions{$doit} }; } else { default_page(); }
However, if instead of clicking on the submit button, the user hits Enter after he has entered a value in the password field and while the cursor is still in the field, the form submission is not detected correctly.
How do you ensure that whether it's the button or Enter that is hit, the form submission is processed correctly?
I hope I've described what I'm trying to achieve in as clear a manner as possible.
I look forward to your enlightenment :)
In reply to Form submit detection... by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |