Solved

Enabling "Enter"

Posted on 1998-09-04
4
147 Views
Last Modified: 2010-04-09
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?
0
Comment
Question by:IsleOfView
  • 2
4 Comments
 
LVL 1

Expert Comment

by:nchalasa062698
ID: 1837361
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
 

Author Comment

by:IsleOfView
ID: 1837362
I'm not using a javascript function at the moment.  It is just straight HTML submitting information to a CGI script.
0
 
LVL 8

Accepted Solution

by:
jbirk earned 20 total points
ID: 1837363
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
 

Author Comment

by:IsleOfView
ID: 1837364
Thanks....that's what I needed to know!
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now