Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Previous Value of Radio button

Not applicable
Is there a way similar to how Dropdown lists work that I can obtain the previous value of a Radio button selection?

2 Replies
Level 10
Level 10
Nope ...once it is selected is selected.
Level 10
Level 10
Hi,<br /><br />I got the following Javacsript from the forum a while back.<br /><br />This section was in the mouseDown event:<br /><br />// Capture initial value of radio Button and save it as a member of the radio button object<br />this.initValue = this.rawValue;<br /><br />Then the following Javascript in the mouseUp event:<br /><br />// Test the captured intial value and set the radio button to<br />// off only if the initial value of the radio group is <br />// the same as the export value for this radio button<br />var localExport = null;<br />for(var i=0;i<this.nodes.length;i++)<br />{<br /> if(this.nodes.item(i).className == "items")<br /> {<br /> localExport = this.nodes.item(i).nodes.item(0).value;<br /> break;<br /> }<br />}<br /><br />if(this.initValue == localExport )<br /> this.rawValue = 0;<br /><br />I am not sure if this is what you want, but it allows the user to deselect a radio button. Both scripts need to be in all of the radio buttons in a group.<br /><br />Good luck,<br /><br />Niall