Skip to main content
Known Participant
July 26, 2019
Answered

conditional readonly signature field

  • July 26, 2019
  • 1 reply
  • 1482 views

in my digital forms using pdf expert on ipad

i have ( submit by email ) button with mailDoc, mouse up run JavaScript action

i added another mouse up action

if(this.getField("CAP1Signature").value !=""){

this.getField("CAP1Signature").readonly = true;

}

////

if(this.getField("CAP1Signature").value =""){

this.getField("CAP1Signature").readonly = false;

}

to make the a signature field is readonly if the field is already signed

and (not) if the field is still blank

to ensure that the file will send with readonly signature

and also make a chance for the user if he forgot to sign before click on the button

my script is working half or the other half

i tried also

if(this.getField("CAP1Signature").value !=""){

this.getField("CAP1Signature").readonly = true;

}else{this.getField("CAP1Signature").readonly = false;}

i got the same result

any help please !?

thank you in advance

This topic has been closed for replies.
Correct answer try67

In the former code you've made a classic error of using the wrong operator in your if-condition. You've used "=", which assigns a value, instead of "==", which compares two values.

The second code is better, but the question is, where did you place it?

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
July 26, 2019

In the former code you've made a classic error of using the wrong operator in your if-condition. You've used "=", which assigns a value, instead of "==", which compares two values.

The second code is better, but the question is, where did you place it?

Known Participant
July 27, 2019

mouse up run a JavaScript action

Known Participant
July 27, 2019

in the button