Enter Key H*ll, control enter key submit button

B

BrianDH

Hi
VB.Net code Behind, Web form.
I am looking for a way to stop my web form application
from firering a button click when the user hits the Enter
key.
I only want to button to bubmit, or exit or clear when
they click the button not in random when they hit the
enter key.

Thanks for the help.
BrianDH
 
B

BrianDh

Thank you!!!!!!!!

Damn microsoft! Now I have to write vb.net, and
javascript in one app. Yep we are moving forward! ;-D

Thanks ;-)
 
B

Bob Lehmann

How is your problem related to Microsoft? The enter key behavior is present
in all modern browsers.

Bob Lehmann
 
A

Anders Matthiessen

BrianDH said:
I am looking for a way to stop my web form application
from firering a button click when the user hits the Enter
key.

I only want to button to bubmit, or exit or clear when
they click the button not in random when they hit the
enter key.

If it is because of the buttonorder making trouble, control what is
submitted when pressing enter :

Public Shared Sub SetDefaultButton(ByRef objTextControl As TextBox,
ByRef objDefaultButton As Button)
objTextControl.Attributes.Add("onkeydown", "if (event.keyCode == 13)
{document.getElementById('" + objDefaultButton.ClientID + "').click();
return false;} else return true;")
End Sub
 

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
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top