One of my colleagues came to me with a problem: He wanted to make the click event of button in his form to be activated when anyone pressed ENTER key. I said it works by default and it needs no tweaking. To my surprise, he showed me that it is not.
Then I went back to the form that I had developed and showed him that I did no extra coding to make it work. The click event just got raised when I hit the ENTER key. He was surprised too.
It would have been easy to implement his requirement with some JavaScript programming, but I wanted to find out the reason behind this contradictory behavior. The only difference between my form and his was that mine had more than one input controls (such as textbox and dropdownlists) and his had only one textbox. Well, after going through a lot of sane thoughts, I did one last insane activity: I added one more textbox control to his form. And it all worked: the click event got raised at the hit of the ENTER key.
I have no clue why this is happening. Do you have any?
Subscribe to:
Post Comments (Atom)
Cookies, anyone?
Our application started having integration issues early March this year. Did I say that was intermittent? To add to our confusion, we coul...
-
Disclaimer: This post has nothing to do with washing or repairing cars. Well, I have been pondering over Managers and Management for lo...
-
I am a Hindu. But I did not know what it exactly meant till recently. More of the awareness came from the Satsangs (spiritual group discussi...
-
One of my colleagues came to me with a problem: He wanted to make the click event of button in his form to be activated when anyone pressed ...
Well, straight from the horse's mouth:
ReplyDeletehttp://aspnet.4guysfromrolla.com/ar
ticles/060805-1.aspx