Copy link to clipboard
Copied
Hi Everyone,
I am relatively new to PDF javascript and I am trying to make a PDF where you can fill it out, click a submit button which will convert it to a Read-Only before sending, but the will convert it back to the original fillable formate once the submission is completed.
I have the javascript to convert the form into a REad-Only, but I am wondering if there is an additional javascript I can add to the following which will convert it back to the original fillable form.
Read-Only Conversion:
for (var i = 0; i < this.numFields; i++)
{
this.getField(getNthFieldName(i)).readonly=true;
}
Just reverse the boolean state:
for (var i = 0; i < this.numFields; i++) {this.getField(getNthFieldName(i)).readonly=false;}
Copy link to clipboard
Copied
Just reverse the boolean state:
for (var i = 0; i < this.numFields; i++) {this.getField(getNthFieldName(i)).readonly=false;}
Copy link to clipboard
Copied
I don't know what it is, but my brain was not thinking that I could just reverse the coding.
Thank you so much, JR.
Copy link to clipboard
Copied
Boolean properties can only have two states: true/false (or 1/0).