Hey all,
I'm having some problems with ordinary HTML forms.
Have a look at the example here:
Say I've named my submit button "DoSubmit" and given it the value "Submit". Now, if I hit the submit button by using my mouse, the form is submitted and the value of "DoSubmit" is correctly sent to the server (as can be seen if you try clicking the mouse in my example page, above).
However, if you use the return key instead of the mouse (and hence rely on the default button) the form is still submitted but the value of "DoSubmit" isn't sent.
Below is the (interesting) code for the page:
Does anybody know why this is happening and how I can avoid this behavior?
Thanks!
I'm having some problems with ordinary HTML forms.
Have a look at the example here:
Say I've named my submit button "DoSubmit" and given it the value "Submit". Now, if I hit the submit button by using my mouse, the form is submitted and the value of "DoSubmit" is correctly sent to the server (as can be seen if you try clicking the mouse in my example page, above).
However, if you use the return key instead of the mouse (and hence rely on the default button) the form is still submitted but the value of "DoSubmit" isn't sent.
Below is the (interesting) code for the page:
Code:
<?php
echo 'DoSubmit: ' . $_POST["DoSubmit"] .'<br/>';
echo 'Cancel: ' . $_POST["Cancel"] . '<br/>';
?>
<form action='problem3.php' method='post'>
<input type='text' name='foo' id='foo'/><br/>
<input type='submit' name='DoSubmit' id='DoSubmit' value='Submit'/>
<input type='button' name='Cancel' id='Cancel' value='Annuller'/>
</form>
Thanks!