By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,838 Members | 1,675 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,838 IT Pros & Developers. It's quick & easy.

action on radiobutton

P: n/a
hello ng

i have a group of 6 radiobuttons with different values.
when i check a radiobutton, i have to calculate something
with the value of the new ckecked radiobutton.

can please someone tell me which action i should use, to get
the correct value? i tried onFocus and onClick, but then i
get the value of the radiobutton which before was checked.

right now, i use onmouseout.

any ideas?

greets
sascha
Jul 23 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Sascha wrote:
hello ng

i have a group of 6 radiobuttons with different values.
when i check a radiobutton, i have to calculate something
with the value of the new ckecked radiobutton.

can please someone tell me which action i should use, to get
the correct value? i tried onFocus and onClick, but then i
get the value of the radiobutton which before was checked.

right now, i use onmouseout.

any ideas?

greets
sascha


It's generally easier to post what you've got - and which isn't working
- to give people a starting point. Since it's a CLICK event that's
triggering the recalculation, Radio.onclick is the correct event
handler to wire up. You can pass that button's value to a function with
this.value and use that in your calculation.

<input type="radio"....onclick="return calc(this.value)" />

If there are other parameters to the calculation that change as well,
you'll need to read the value of the currently checked radio as well,
requiring a different technique. Again, the nuts & bolts description of
what you're doing is invaluable.

Jul 23 '05 #2

P: n/a
Sascha wrote:
hello ng

i have a group of 6 radiobuttons with different values.
when i check a radiobutton, i have to calculate something
with the value of the new ckecked radiobutton.

can please someone tell me which action i should use, to get
the correct value? i tried onFocus and onClick, but then i
get the value of the radiobutton which before was checked.

right now, i use onmouseout.

any ideas?

greets
sascha


It's generally easier to post what you've got - and which isn't working
- to give people a starting point. Since it's a CLICK event that's
triggering the recalculation, Radio.onclick is the correct event
handler to wire up. You can pass that button's value to a function with
this.value and use that in your calculation.

<input type="radio"....onclick="return calc(this.value)" />

If there are other parameters to the calculation that change as well,
you'll need to read the value of the currently checked radio as well,
requiring a different technique. Again, the nuts & bolts description of
what your're doing is invaluable.

Jul 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.