Solved

Enabling "Enter"

Posted on 1998-09-04
4
152 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
form button worked now it doesnt anymore 9 53
Link a VBS to an HTA 6 36
ASP server side get value 15 20
If condition on Html with Asp 11 14
Introduction The Google Maps API offers various ways to draw dynamic and static maps.  Using a combination of PHP and JavaScript, you can draw active JavaScript maps that allow pan-and-zoom in the client browser window.  You can also draw "static" …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

776 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