Enter Key in textbox causing Postback....

  • Thread starter Thread starter Gill Smith
  • Start date Start date
G

Gill Smith

In my ASP.Net application when the user hit the enter key and the focus is
on the edit box causing the page to postback. How to avoid this ?
-Gish
 
Gill said:
In my ASP.Net application when the user hit the enter key and the focus is
on the edit box causing the page to postback. How to avoid this ?
-Gish
You can disable the enter key for the whole page:

<Script language=javascript>
document.onkeydown = doKey;

function doKey(e) {
if (event.keyCode==13)return false;
}
</script>

regards
 

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

Similar Threads


Back
Top