chelvis
04-04-2003, 07:34 PM
I have a form with text boxes. Also instead of a submit button, I have an image. Once the user fills out the form, if he hits the enter key the form should submit. But since I am using an image nothing is happening. How can I write a javascript so when the user hits the enter key the form automatically gets submited? Here is what I wrote which is not working:
<form name="newcustomer" method="post" action="http://www.hotmail.com">
<input type="texbox" size="30" name="fname"><br>
<input type="textbox" size="30" name="lname"><br>
<A HREF="javascript:document.newcustomer.submit()"><img src="images/save.gif" border="0"></a>
<form name="newcustomer" method="post" action="http://www.hotmail.com">
<input type="texbox" size="30" name="fname"><br>
<input type="textbox" size="30" name="lname"><br>
<A HREF="javascript:document.newcustomer.submit()"><img src="images/save.gif" border="0"></a>