Entry
How can I make the 'submit' button to default? [so I can press it using the <ENTER> key]
Nov 12th, 2002 17:43
Alex Ginzburg, Gaby Gyore,
Let's say your form's name is "formA" and it looks something like...
<form name='formA' method='POST' action='http://www.bla.com'>
<input type='text' name='text1'>
<input type='submit' value='Submit'>
</form>
and using an outside textfield, by key event keypress, pressing enter,
which is ascii code 13, will submit the formA form.
<input type='text' onkeypress='if(event.keyCode==13)
{document.formA.submit();}'>