Copy link to clipboard
Copied
I am using this script
this.getField("cust Tel No").required = !event.target.isBoxChecked(0);
and it works but when i try and add extra text boxes it doesnt, where am i going wrong
this.getField("cust Tel No").required = !event.target.isBoxChecked(0); &&
this.getField("cust Tel Ar").required = !event.target.isBoxChecked(0);
Drop the "&&" at the end of the first line.
Copy link to clipboard
Copied
Drop the "&&" at the end of the first line.
Copy link to clipboard
Copied
Hi thanks,
I have 3 radio buttons, when i use the same script on the second radio button it doesn't work, any reason why and on the third radio button i don't want the text boxes to be required so how do i cancel the required?
Copy link to clipboard
Copied
Please describe how you want this to work, exactly.
Copy link to clipboard
Copied
I have 3 radio buttons and 4 text field that need to be completed if either the first or second radio button is checked. If the 3rd radio button is checked then i dont want these text boxes to be required. The radio buttons are choice 1, choice2 and choice 3, choice 3 being the button canceling the text boxes being required
Copy link to clipboard
Copied
What's the name of the radio-button group?
Copy link to clipboard
Copied
Also, what should happen if no radio button in the group is selected at all?
Copy link to clipboard
Copied
the radio group is required, there has to be one of the radios checked
Copy link to clipboard
Copied
I didn't follow what you meant, and the fact the field is required doesn't mean it will always have a selected value, which you have to take into consideration when writing the script.
Copy link to clipboard
Copied
I want to put at the end of the form a script that will ensure all required fields are completed before the form can be signed, however I am not there yet so am leaving that for another day
Copy link to clipboard
Copied
Well, you can use this code as the custom calculation script of a (hidden) text field to achieve it:
var v = this.getField("Group19").valueAsString;
var b = (v=="Choice 1" || v=="Choice 2");
this.getField("cust Tel No").required = b;
this.getField("cust Tel Ar").required = b; // etc.
Copy link to clipboard
Copied
fantastic thank you
Copy link to clipboard
Copied
its called Group19, but i just figured out to change the 0 to 1 for the second button so now i just need to know how to cancel the text box being required