By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,960 Members | 2,238 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,960 IT Pros & Developers. It's quick & easy.

Onchange and Onsubmit called simultaneously when Enter key is pressed in Mozilla

P: 10
hi,

I'm facing a problem in Mozilla which is ok in Ie.

I have few input boxes in my page. After entering some text in one field and pressing the enter key, Onchange event is called for every wrong input and cursor goes back to re-enter the text. In Mozilla when enter key is pressed it first called the onchange event and then simultaneously calling the onsubmit function written in Javascript. In IE it is not throwing the onsubmit event before going to the next field unless it is the last field of the page.
What is the problem in Mozilla?

Please suggest necessary soultion.

Regards,

Sourav
Jul 4 '08 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
The enter key can trigger submission. You can capture the event and set the focus to the next field instead (rather give it a tab behaviour).
Jul 4 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.