473,394 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

action on radiobutton

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
2 1662
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: VK | last post by:
Hi! What I'm missing in following code? Cannot get the values of radiobuttons. Starting only one class (GetVariant), it works. When I put two classes together, it doesn't. Regards, VK from...
11
by: William Gill | last post by:
I am placing radiobuttons in a 4 X 4 matrix (using loops) and keep references to them in a 2 dimensional list ( rBtns ). It works fine, and I can even make it so only one button per column can be...
0
by: rodrigo | last post by:
I have a Asp.net table control that I dynamically add rows from a SQL database. Inside the table, I add radiobuttons and they all have different ID numbers according to BindChain() Looking In...
3
by: sofie | last post by:
Hello all, I use the following javascript function in a html document to set the level of one of eight available radiobuttons. The line that's commented out works fine under IE, but I need to...
2
by: JeffFinnan | last post by:
<form name=form1> Load in Viewer Window: <input name="radiobutton" type="radio" value="1" checked onClick="1"> 1&nbsp;&nbsp;&nbsp; <input type="radio" name="radiobutton" value="2" onClick="2">...
3
by: dave | last post by:
I have half a dozen web form radio buttons on a web form. Each of them is set to postback=true. However, if for instance radiobutton1 is already selected and the user selects it again, it performs...
6
by: Radiobutton via DotNetMonster.com | last post by:
i need help with radiobuttons. i am useing 1button and 2 radiobuttons i am trying to make it so when u select a radiobutton and hit button1 it will clear radiobuttons 1 and 2. -- Message...
4
by: Igor | last post by:
RadioButton have property Checked (true or false). If I make RadioButtons with code, without drawing by mouse than I have problems. I write like this: Dim rb(0 To 2) As RadioButton Dim n As...
8
by: =?Utf-8?B?UmljaA==?= | last post by:
If you enclose a group of radiobuttons (option buttons in MS Access) in an option group control (a frame control) in Access -- the frame control will return the index of the option button that is...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.