Fillable PDF to Read Only, back to Fillable

New Here ,
Jan 27, 2021 Jan 27, 2021

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;
}

TOPICS
JavaScript, PDF forms

Views

106

Likes

translate

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
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Jan 27, 2021 Jan 27, 2021
Just reverse the boolean state:   for (var i = 0; i < this.numFields; i++) {this.getField(getNthFieldName(i)).readonly=false;}

Likes

translate

Translate

Translate
Adobe Community Professional ,
Jan 27, 2021 Jan 27, 2021

Copy link to clipboard

Copied

Just reverse the boolean state:

 

for (var i = 0; i < this.numFields; i++) {this.getField(getNthFieldName(i)).readonly=false;}

Likes

translate

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
community guidelines
New Here ,
Jan 27, 2021 Jan 27, 2021

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. 

Likes

translate

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
community guidelines
Adobe Community Professional ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

Boolean properties can only have two states: true/false (or 1/0).

Likes

translate

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
community guidelines