View Full Version : Disable Enter on an HTML form and tab order!

06-21-2005, 03:09 AM
I'm not sure if this needs to go in to the ASP category or not but I think it's a Javascript solution.

I have a web page on which is a form.
It has 8 controls which the last two at the bottom of the page are Submit and Reset buttons. The other controls are a select box / check box / and text boxes. I'm stumped on two items.

1. How do I prevent the form from being submitted if the user hits enter on when the user is on a control other than submit or reset. In essence I want the form to disregard all enter key strokes unless the user is on the submit/reset button.

2. How do I alter the tab order on a web page. I have two controls that are essentially "ReadOnly" ( actually a small calendar will pop up and display a calendar when clicked. Because these controls won't be used alot of the time I don't want them in the tab order.

I've tried the NOTAB property and I've tried the TABORDER property. However, it still seems to require 2 tabs to get below the last two input boxes.

Any ideas?