Enter Key Posts the Page

P

Prakash

i am using a textbox and i need to popup a dialog on Enter Key, i have used
javaScript for it.The pop-up is coming but the page gets posted.I am using
asp:button to save the information in page.i have set tabindex and focus but
nothing is working,how to stop the page being posted, Is there any way, Help
me.

Thanks in Advance.

Prakash.V
 
K

Karl Seguin

Have you tried cancelling the event in a cross browser manner?

Something like:
function DoSomething(e)
{
window.open(...);

if(navigator.appName == "Microsoft Internet Explorer")
{
event.returnValue=false;
event.cancelBubble=true;
else
{
e.preventDefault();
}
return false;
}
 

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

Top