| Author |
Which javascript method is best to call on Radio button value change?
|
Santhosh Kalisamy
Ranch Hand
Joined: Apr 15, 2008
Posts: 55
|
|
Hi,
I do have a radio button (using Struts2 tag) with 2 possible values.
Right now, I want to call javascript method incomeFundsToChange() whenever the value is changed on Radio button from Yes --> No [or] No --> Yes.
Which Javascript method is best? I am bit confused, which to use.
I tried with onchange, it works only sometime like, when I click outside of the radio button...etc.
Which event method (like onchange, onmouseup..etc) is better to use? so it will be called, whenever there is a change on Radio button value!
Thanks in Advance.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56201
|
|
|
Please do not post server-side markup; it is not useful in this forum. Be sure to post the actual HTML that is generated. That's what the browser and JavaScript operate upon.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Santhosh Kalisamy
Ranch Hand
Joined: Apr 15, 2008
Posts: 55
|
|
will do. Thanks.
I thought, it is a simple question to understand. anyhow, I found the answer.
onclick method is the best one to use, when you want to capture the changed value on change event.
onchange is called only when the element loose the focus.
Thank you for looking. closing the thread.
|
 |
 |
|
|
subject: Which javascript method is best to call on Radio button value change?
|
|
|