problem with buttons
-
if i put a button on my asp.net page and then click enter in a text box for wxample, it clicks the button and does the action attached to it... annoying, how do i stop this ps. i know its a really dumb qeastion
Mr. Cully wrote: i know its a really dumb qeastion Not really -- at least I didn't know the whole answer. Apparently, the ENTER key always causes a page to submit; so, the work-around is to either a) use ASP.NET Validators (RequiredFieldValidator, for example) that catches empty fields, etc., or b) stop the ENTER key completely. I found an example of cancelling the ENTER key here[^]. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
-
Mr. Cully wrote: i know its a really dumb qeastion Not really -- at least I didn't know the whole answer. Apparently, the ENTER key always causes a page to submit; so, the work-around is to either a) use ASP.NET Validators (RequiredFieldValidator, for example) that catches empty fields, etc., or b) stop the ENTER key completely. I found an example of cancelling the ENTER key here[^]. What a piece of work is man, how noble in reason, how infinite in faculties, in form and moving how express and admirable . . . and yet to me, what is this quintessence of dust? -- Hamlet, Act II, Scene ii.
A related article : http://www.dotnetspider.com/Technology/KBPages/212.aspx :zzz:----------------------------------------------------------------------:(( T Manjaly C# Tutorials and samples : http://www.dotnetspider.com