| Author |
invoke js method
|
Piradharsan Navaratnam
Greenhorn
Joined: May 15, 2007
Posts: 14
|
|
In my form i have to invoke a js method before submit. So i added th below code to the submit button. input type="submit" onnclick="return jsmethod()" ---------I hv added nn becaz it is not allowing here--------- It is invoking the method when i click the submit button. But it is not invoking the js method when i press enter. Why is that??? Its invoking the jsmethod() when i click submit button as well as on enter key press on all other forms except one form why???
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56538
|
|
Originally posted by Piradharsan Navaratnam: I hv added nn becaz it is not allowing here
Please use real words when posting to the forums. Abbreviations such as "hv" in place of "have" only serve to make your posts more difficult to read and less likely to generate useful responses. Please read this for more information.
Why is that???
In English, questions are terminated with a single question mark. Please refrain from using more than one to end such a sentence.
It is invoking the method when i click the submit button. But it is not invoking the js method when i press enter. Why is that?
Because the Enter key has nothing to do with the submit button. Why would you expect a click handler for a button to be invoked without a mouse click? If want to execute code on the submission of a form, rather than a specific triggering event such as a mouse click, declare an onsubmit handler for the form. [ August 16, 2007: Message edited by: Bear Bibeault ]
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: invoke js method
|
|
|