To make a field required you can use this code:
this.getField("FieldName").required = true;
I apoligize for not spelling it out all the way. I hope I did not offend anyone.
That makes the radio buttons required but what my goal is is to make them required only if the Credit Card radio button is selected from the button group payment options.
From your description above it seemed like you already have code in place to make some fields visible (or hidden) based on the selection... So all you need to do is add this code to what you already have.
Ok - this is the code I have in the first text box after the payment options.
event.target.required = getField("Payment Options").valueAsString === "Credit Card";
I have similar code in the other text boxes associated. Would I add it to that? I tried putting it in the individual radio buttons under the actions tab for radio button group (card type) but it did not do anything. Feeling very dense right now.
No, this is not a good approach. What is triggering this code? Entering the field?
You should instead place the following code as the custom validation script of "Payment Options":
this.getField("OtherFieldName").required = (event.value=="Credit Card");
To trigger the field the user is clicking on the radio button. It is a required field. If they select cash or check the next text fields are not required. If they select the Credit Card radio then the text fields for cardholder name, number are made required. The only thing that is not working is the radio buttons for card type.
I added this code to the payment options on the actions tab for the credit card button (I made the "other field" Credit Card Type) but it is not making the radio buttons for card type required.
I think it will be easier for me to understand what's going on if I'd see the actual file.
Can you share it, either via a file-sharing site or privately by email?
Sure thing. I will be glad to email it. Just let me know where.
try6767 at gmail dot com