Skip to main content
Inspiring
August 3, 2017
Question

I have already written script for disabling the signature field until 5 other fields have been completed. But I don't know how to do that with 5 buttons I have.

  • August 3, 2017
  • 1 reply
  • 518 views

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;

}

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
August 4, 2017

You can set the buttons also as readonly.

SIPRNet11Author
Inspiring
August 4, 2017

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.

try67
Community Expert
Community Expert
August 4, 2017

Yes, my bad.  Radio buttons.


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.