Set to Radio Button to Null

C

CB

I have two questions that are set up as radio buttons. When I answer one of
them as Yes, the second question appears. Let's say I answer the second
question and then go back to the first question and change the value to No.
I have it set up so that the second question disappears because the new
answer to the first question is No. I also want it to remove the answer for
the second question. I know that I need to put a rule on the first question,
which I have done, but I can't get it to wipe out the answer to question 2
completely. All I can get it to do is set the answer to "No" for the second
question. I want it to appear that nothing was done to the second question
at all. Is that possible? Please bear in mind that I am a Newbie.
 
B

Ben Walters

Hey CB,
Simply set the value of the second question to a blank string, that should
clear the answer for you.
Steps:
1: Open the properties for the first qestion field
2: Open the rules dialog.
3: Add a new action to the rule that runs when the user selects "No", in
that new action from the first drop down select "Set a field's value" (two
text boxes will appear below the drop down)
4: Click the button next to the first text box and select the field for
question 2
5: leave the second text box blank then commit your changes.

If you need more details letme konw
Hope this helps
Cheers
Ben Walters
 
R

Ravi G

Hi,
In on-afterchange event run the following code when you select ‘NO’ for the
first question
SetNodeValue("second question field X-path", string.Empty);
 
C

CB

I tried the approach you suggested. The second field has No selected instead
of being blank. I then tried all of your steps a second time and put the
word blank in the second field mentioned in step 5. That also rendered the
same outcome. I tried putting string.Empty in the field mentioned in step 5
and nothing changed.

I don't know if it makes a difference, but my form is not sending
information to a database or Excel spreadsheet.

Any advice?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top