Skip to main content
Participant
March 22, 2019
Answered

How do I make a field required right before the signature is entered?

  • March 22, 2019
  • 1 reply
  • 2950 views

I need some help on a form I'm working on.  The form will be submitted twice.  The first part of the form is for the employee to fill out.  Once they have it filled out, I figured out how to lock those fields and then I also hide their submit button.   I'm having a problem with the second portion where the customer has to type their name, enter the date and digitally sign the form and then it gets submitted back via email.  My problem is that once the customer receives the form to do the 2nd part, I need to make the "type their name" and "date" fields required.  I tried to add javascript to the signature field so they would become required , but it does the signature and then makes the fields required witch just locks up the form since the signature was added first.  Can anyone help me figure out how I can do this?

This topic has been closed for replies.
Correct answer de_believer93

Hi Blaine_Window,

You might no longer need this but here is what I did:

I added a new button beside the signature and called it "Enable Sign."

Disable the signature box.

Add the following JavaScript to run when the button is clicked:

this.getField("P1.S1").readonly = true;
var enableSig = true;
for(var i = 1; i <= 3;i++){

var str = this.getField("P1.T"+i).valueAsString;
if(!str){
enableSig = false;
}
}

if(!enableSig){
app.alert("All fields must be filled.");
this.getField("P1.S1").readonly = true;
}else{
this.getField("P1.S1").readonly = false;
}

You wil have to edit some part of the code to fit your needs.

Hope that helps!

1 reply

de_believer93Correct answer
Participant
September 18, 2019

Hi Blaine_Window,

You might no longer need this but here is what I did:

I added a new button beside the signature and called it "Enable Sign."

Disable the signature box.

Add the following JavaScript to run when the button is clicked:

this.getField("P1.S1").readonly = true;
var enableSig = true;
for(var i = 1; i <= 3;i++){

var str = this.getField("P1.T"+i).valueAsString;
if(!str){
enableSig = false;
}
}

if(!enableSig){
app.alert("All fields must be filled.");
this.getField("P1.S1").readonly = true;
}else{
this.getField("P1.S1").readonly = false;
}

You wil have to edit some part of the code to fit your needs.

Hope that helps!