Enabling "Enter"

I have a form in Netscape, that I would like to have submitted when the user hits the "Enter key".  This seems to work by default in IE, but how do you make it work for Netscape?
IsleOfViewAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jbirkConnect With a Mentor Commented:
What causes the forms to submit automatically is the fields which are in the form and the field which is currently focused.  If there is only one text field, it will automatically submit on enter, but if there are more than one text field it will never automatically submit.  Then the field which is in focus determines whether or not it will submitted if there is only one text field.  This unfortunately differs with EVERY browser.  IE allows it in more different kinds of fields than Netscape does.

Now in order to ensure that pressing enter will submit the form, the only thing I can think of is to write javascript to trap the keypressed event, and if it is enter submit the form via javascript.  This is 4+ browsers only and can get complex because  netscape and IE have totally different incompatible event handling models.

Good luck!
-Josh
0
 
nchalasa062698Commented:
Are you calling a javascript function to submit the form , if so using the
onsubmit event handler in the FORM tag will  submit the form when you press enter
in Netscape.

<FORM ACTION=" " METHOD="POST" OnSubmit="jv_ function()".
0
 
IsleOfViewAuthor Commented:
I'm not using a javascript function at the moment.  It is just straight HTML submitting information to a CGI script.
0
 
IsleOfViewAuthor Commented:
Thanks....that's what I needed to know!
0
All Courses

From novice to tech pro — start learning today.