Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Button to allow data entry

New Here ,
Mar 30, 2023 Mar 30, 2023

Hello Everyone,

 

I'm trying to figure out how to have a button run a JavaScript to check that a signature block is signed before allowing any other data to be input into the fillable form. Basically I am wanting to have some one Sign  on the top of the form that will allow for data entry throughout the rest of the form. 

 

Thanks

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF forms , Security digital signatures and esignatures
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 31, 2023 Mar 31, 2023

Hi,

 

That is a bit of an odd workflow, normally we would make fields read only after a signature field is signed. but the signature field has a property -

BarlaeDC_0-1680272096664.png

 

Which may be able to be used to check the signature using the return values

BarlaeDC_1-1680272139406.png

 

Then you could change the status of the fields they are supposed to fill in.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2023 Apr 03, 2023

Yes it is a bit odd. The purpose of it is to have qaulity be our first signature to make the document ready for the floor. Then I'm looking to have a check for my people on the floor to click and it will make sure quality signed the doc before they proceed. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 04, 2023 Apr 04, 2023

Une image vaut mieux qu'un long discours :

 

Capture_2304041242.png


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 04, 2023 Apr 04, 2023

This is the code I'm runing but it's picking up the entire doc. Not sure how to point it to that one block.

 

var emptyFields = [];

for (var i=0; i<this.numFields; i++) {

var f = this.getField(this.getNthFieldName(i));

if (f!=null && f.type!="button" && f.required && f.valueAsString==f.defaultValue) {

emptyFields.push(f.name);

}

}

if (emptyFields.length>0) {

app.alert("You must fill in the following fields:\n" + emptyFields.join("\n"));

} else {

for (var i=0; i<this.numFields; i++) {

var f = this.getField(this.getNthFieldName(i));

if (f!=null) f.readonly = true;

}

}

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 14, 2023 Apr 14, 2023

Hi,

 

a PDF form doesn't really have sections from a programitic point of view, they may be ordered in sections for the user, but they are just form fields to the program, are you wanting to limit to the check you have created to certain fields then the easiet way would be to name them in a manner that you know which section they are in.

 

then in your code you could add something to check it is a field from the area you want, for example if you had fields named:

firstname, lastname, city, dateofbirth

thatn you wanted filled in for the first signature you could change the name to

sig1.firstname, sig1.lastname, sig1.city, sig1.dateofbirth

then you could add a simple check into your if statement

if ( f.indexOf("sig1") != 0) // this would mean that sig1 has been found.

 

Hope this helps.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
May 01, 2023 May 01, 2023
LATEST

Yes that helped. I ended up using this:

 

if (getField("QA_Sig").value !== '')  // Means the signature is present

{

   app.alert("You have a QA Stamp",3);

}

else

{

   app.alert("You don't have a QA Stamp");

}

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