Disable enter key in a form

a form has a field and a button. I'm doing some lookup on the button. When I type some values in the field and click on the button, It works fine. On Opera and Firefox, when I type some values in the field and press ENTER key, it works fine, returns the document.

But when I enter a text and press enter instead of pressing that button, browser displays "Form processed"message

Is there any way to disable enter key in the browser.
ninteen83Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ninteen83Author Commented:
Internet explorer displays "Form processed"message ..
0
madheeswarCommented:
//For fields which enters Enter Key from the field
var NS1 = (window.Event) ? 1 : 0;
function checkKey(e1) {
var code1 = (NS1) ? e1.which : event.keyCode;

if (code1 == "13"){
directory();
return false;
}
}

call this function where ever needed.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ninteen83Author Commented:
Works fine..

thanks
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.