Enter Key in textbox causing Postback....

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
 
M

MichalR

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
 
S

Steve C. Orr [MVP, MCSD]

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top