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

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

746

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

Community Expert , 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;}

Votes

Translate

Translate
Community Expert ,
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;}

Votes

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. 

Votes

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
Community Expert ,
Jan 28, 2021 Jan 28, 2021

Copy link to clipboard

Copied

LATEST

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

Votes

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