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.

Participant ,
Aug 03, 2017

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;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

146

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

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.

Participant ,
Aug 03, 2017

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;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

147

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Aug 03, 2017 0
Adobe Community Professional ,
Aug 04, 2017

Copy link to clipboard

Copied

You can set the buttons also as readonly.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Participant ,
Aug 04, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Most Valuable Participant ,
Aug 04, 2017

Copy link to clipboard

Copied

Do you mean "radio-buttons"? Buttons don't have a selectable value...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Participant ,
Aug 04, 2017

Copy link to clipboard

Copied

Yes, my bad.  Radio buttons.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Most Valuable Participant ,
Aug 04, 2017

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Participant ,
Aug 04, 2017

Copy link to clipboard

Copied

Can you give me an example of your opinion?  I'm not sure what you're talking about.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Most Valuable Participant ,
Aug 04, 2017

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

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0
Participant ,
Aug 04, 2017

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".

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Aug 04, 2017 0