You can copy the selected values of check-box or radio button group to a
text field using a simple calculation script, like so:
event.value = this.getField("Radio1").value;
Set that text field as read-only and you're basically done...
Thanks for the reply...
If I did that, then wouldn't I have to create a new text field for each check box option and radio group? If so, then if the customer did not check some of the check box options, then the text box on the summary for that option would be blank. I'd rather not have the blank areas...just a clean list of the selected options. Or am I misunderstanding your post?
Or...is there a way to concatenate the selections-only into a list in one large text field to create the summary? Some kind of loop maybe?
You can use a single text field and write a more complex calculation script
that will append all of the values from the different fields in the file
into a single piece of text. Be aware, though, that the default value of a
check-box or radio-button when it's not selected is not a blank string but
Ok... can you give me an example of what that script might look like? I'm not a master programmer by any means, but if I could see what you're talking about I could probably figure it out.
Here's a generic example (this will populate a multi-line text field):
var v1 = this.getField("Text1").value;
var v2 = this.getField("Text2").value;
var v3 = this.getField("Radio1").value;
var v4 = this.getField("CheckBox1").value;
var v = "";
if (v1!="") v+= "Value1 is: " + v1 + "\r";
if (v2!="") v+= "Value2 is: " + v2 + "\r";
if (v3!="Off") v+= "Value3 is: " + v3 + "\r";
if (v3!="Off") v+= "Value4 is: " + v4 + "\r";
event.value = v;
Thanks! That makes sense. My only other question is regarding the radio buttons. Your example for "Radio1" is referring to the radio group name, right? ...and not an individual radio button?
That's right, you can only access the entire group...
Great! Thanks again for your help.
Everything is working great and rendering fine except for the radio groups. I think I have something backwards...in a group of three, it will show the two that are not selected rather the one that is selected.
Here's an example of what I have for a radio group...
var hf = this.getField("HF").value;
var v = "";
if (hf!="HF.Option 1") v+= "- Option 1" + "\r";
if (hf!="HF.Option 2") v+= "- Option 2" + "\r";
if (hf!="HF.Option 3") v+= "- Option 3" + "\r";
event.value = v;
HF is the name of the radio group with Option 1, Option 2, and Option 3 being the assigned Radio Button Choices. I've tried it as shown as well as without the HF in front of the options.
If the values are Option 1, Option 2, etc., why are you check if they are
"HF.Option 1", "HF.Option 2", etc.? In other words, drop the "HF.". Also, I
think your logic is backwards... The != operator means "does not equal". If
you want to check it if it is equal, use == instead of != .
== Thanks... I knew it had to be something stupid. I realize the != is "does not equal", but when I took it out originally, I forgot to put the other = in ...and of course it didn't work, so I had just put it back in to try something else. And yes...I did try it without the HF in front... and I thought that's how it should be, but like I said, it didn't work so I was just trying different things. Just dumb newbie mistakes.