I have an issue where if no radio is selected it still returns "false"
I read in the forum that if nothing is selected on radio or checkbox it returns value of "Off" so i tried adding code to convert that to "Not Selected" but it did not work but it still says false. What am i missing?
Also of small note: I know the true/false is switched with Yes/No but i couldn't figure out how to assign values to each radio button. It seems the first radio button in code by default returns false and i wanted the java window radios to be Yes/No instead of No/Yes. I can live with it though. Just thought I would explain why they were switched. I really just need the radio to report "Not Selected" to my text field. Thanks for any help i may receive!
var textValue2;
if (testValue2==false) textValue2 = "Yes";
else if (testValue2==true) textValue2 = "No";
else if (testValue2==off) textValue2 = "Not Selected";
this.getField("Outsourced").value = textValue2;
The code you then use will depend on what you used for the buttons values and where you want to place it. For what you're talking about, you would typically use a custom calculate script for the text field, something like:
// Get the value of the radio button
var v = getField("radio1").value;
// Set the value of this text field
event.value = v === "Off" ? "Not selected" : v;
This assumes that you set the Button Value for each radio button to whatever it is you want to display when it's selected. Change "radio1" in the code about to the actual names you gave to each radio button in the group.