Copy link to clipboard
Copied
This is my current script:
if(event.value != ""
&& this.getField("Name").value != ""
&& this.getField("Phone Number").value != ""
&& this.getField("Email Address").value != ""
&& this.getField("Directorate").value != "Select from Dropdown") {
this.getField("User's Signature").readonly = false;
} else {
this.getField(User's Signature").readonly = true;
}
Copy link to clipboard
Copied
You can set the buttons also as readonly.
Copy link to clipboard
Copied
My apologies, my question wasn't clear. The user will need to answer the first 5 "fillable" questions (One of them being a dropdown menu) and the other 5 "button" questions, they need to select either YES, NO, or N/A. Once they've completed all 10 questions, the digital signature button will be available.
Copy link to clipboard
Copied
Do you mean "radio-buttons"? Buttons don't have a selectable value...
Copy link to clipboard
Copied
Yes, my bad. Radio buttons.
Copy link to clipboard
Copied
OK, the default value of a radio-button group when no specific field in it is selected is "Off", so you can just add it to your current code, just like the text fields or drop-downs.
A better way, IMO, is to compare the value to the default value, instead of hard-coding those values into your code. If the value equals the defaultValue, that means the field has not been filled in.
Copy link to clipboard
Copied
Can you give me an example of your opinion? I'm not sure what you're talking about.
Copy link to clipboard
Copied
This is what I mean:
if(event.value != ""
&& this.getField("Name").valueAsString != this.getField("Name").defaultValue
&& this.getField("Phone Number").valueAsString != this.getField("Phone Number").defaultValue
&& this.getField("Email Address").valueAsString != this.getField("Email Address").defaultValue
&& this.getField("Directorate").valueAsString != this.getField("Directorate").defaultValue) {
this.getField("User's Signature").readonly = false;
} else {
this.getField("User's Signature").readonly = true;
}
Edit: Code fixed
Copy link to clipboard
Copied
Very good! Thanks for your help on this! I was able to get every field working properly and the form is a hit in the office, haha! Thanks again! I'll post my final code later. I did notice, for anyone that may copy this...Line 8 (if no one has noticed yet), I forgot to input a beginning quote in front of "User's".