Thauwa Posted December 19, 2010 Share Posted December 19, 2010 Hey guys, I need to know how I could prevent a button from submitting form data when the "Enter" button on the keyboard is hit. The only way the user then could submit data is then by clicking. How could I achieve this? Thanks in advance! Regards Thauwa Quote Link to comment Share on other sites More sharing options...
arbitter Posted December 19, 2010 Share Posted December 19, 2010 don't know how to do it with an input submit button, but using a div with an onclick to submit the values, seems a method that should do it... After a single search on google: onkeypress=”return event.keyCode!=13″ within your input should do the trick. Quote Link to comment Share on other sites More sharing options...
Thauwa Posted December 19, 2010 Author Share Posted December 19, 2010 Ah thanks. I really appreciate your kind help. Quote Link to comment Share on other sites More sharing options...
arbitter Posted December 19, 2010 Share Posted December 19, 2010 Glad I could help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.