I have a very simple form, part of which has a series of radio buttons that allow the client to choose options. What I have been attempting to do is configure the check boxes so that when a radio button is selected, a number would be written to a blank, invisible number field. All the invisible number fields would then be added up as part of the totals.
What I can't seem to figure out is how to write information to another field when a radio button is clicked. Has anyone here ever tried that?
Views
Replies
Total Likes
You woudl put code on teh RadioButton Group ...not the radioButton object. I woudl use the change event and write something like this:
if (this.rawValue == 1){
//The radio button is on
NameofHiddenField.rawValue = NameofHiddenField + number you want to set
} else {
//The radio button is off
NameofHidddenField.rawValue = NameofhiddeField - number you want to set
}
Hope that helps
Paul
I can see where you are going with this: One thing I need clarification on though...
When I select the Radio Button Group itself I get
form1.#subform[0].RadioButtonList[2].scrapbookYES::mouseUp - (JavaScript, client)
form1.#subform[0].RadioButtonList[2].#field[1]::mouseUp - (FormCalc, client)
In this case, where would I place the code you suggested?
Views
Replies
Total Likes
Your code seems to work with one exception: I have it working so a number is populated in the invisible field. Now the problem is, if the radio button is not checked, the number stays.
Views
Replies
Total Likes
So that is in the else portion of the if statement. You woudl basically do the reverse that you did to add the number. You could set the field.rawValue = 0
Paul
We are very close!
What you suggested is working. One unfortunate side effect is that the radio buttons do not show anything inside them when they are clicked. Here is an example:
form1.#subform[0].RadioButtonList[3].propboxYES::mouseUp - (JavaScript, client)
if
(this.rawValue = 1){
//The radio button is on
propbox.rawValue
= 50
}
form1.#subform[0].RadioButtonList[3].propboxNO::mouseUp - (JavaScript, client)
if
(this.rawValue =1){
//The radio button is on
propbox.rawValue
= 0
}
With the code above, its making the proper entry in the invisible box "propbox" when either YES or NO radio buttons are clicked in this case. I am not sure why the checks are not showing in the circles though. Any ideas?
Views
Replies
Total Likes
The command with the if statement needs two equal signs ==. A single equal means that you are putting the value 1 into the field and the == sign means that you want to compare the value of the radio button to the value 1.
Paul
Views
Replies
Total Likes
Gotcha!
I think the reason why I altered that part in the first place was that when there was "==" in place, the check boxes worked, but when I clicked NO, the number would not be changed to 0. I am not sure why.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies