using the "enter" key to change fields on order form

A

Arnold

I have a CGI script order form on my website that sends me an email with
the person's order and contact information on it. The problem is that if
the person hits the "enter" key to change fields on the order form, the
form gets sent to me before they are finished filling it out. Then they
have to start all over again. To change fields they have to hit the "tab"
key. I want to make it so that hitting either the "enter" key or the "tab"
key will change fields, and then to send the order, they will have to click
on the "order now" button at the bottom of the page. Is this possible?
Thank you very much in advance for your help.

arnold
 
M

Mark Fitzpatrick

With JavaScript you should be able to do this in all browsers. There's a
script to do just this at:
http://javascript.internet.com/forms/tab-key-emulation.html

You may have to test it in different browsers though as I haven't used this
one before. Also, let your users know that they will have to hit the submit
button as a lot of people still expect to have to hit the Enter key to
submit.

Hope this helps,
Mark Fitzpatrick
Microsoft MVP - FrontPage
 
J

Jon Spivey

Hi Arnold,

I'm not sure that's a good idea - most people expect to use tab to move from
field to field and enter to submit the form. I wouldn't want to mess with
the behaviour most users expect from their browser.

A better option would be to validate the form to ensure it's not submitted
until all required fields have been filled in. Right click your form fields
and hit validation - there's a number of options you can choose to ensure
your fields are filled out correctly. If you can't find something there that
meets your exact needs post back and we'll help you out
 
A

Arnold

Hi Arnold,

I'm not sure that's a good idea - most people expect to use tab to
move from field to field and enter to submit the form. I wouldn't want
to mess with the behaviour most users expect from their browser.

A better option would be to validate the form to ensure it's not
submitted until all required fields have been filled in. Right click
your form fields and hit validation - there's a number of options you
can choose to ensure your fields are filled out correctly. If you
can't find something there that meets your exact needs post back and
we'll help you out


Thanks Jon,
I like your idea too. I've already tried it, and this will solve my
problem easily. Believe it or not, many times I've gotten the same
partial order 2 or 3 times where they accidentally hit the "enter"
button to change fields. I've done the same thing. It's just the normal
way to move down a page I guess, and we are creatures of habit. But it
won't happen on my site again. Thanks! :blush:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top