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

Document becomes read only upon submission except for generated template page.

Explorer ,
Aug 04, 2021 Aug 04, 2021

Copy link to clipboard

Copied

My form has two parts. The user enters in the fields and signs the document then clicks a submit button. Upon clicking the submit button the document becomes read only, generates a template page that SHOULD NOT BE READ ONLY, and links the document to an email.

 

I had this script working but had to add addiontional fields to the template page that should not be read only. Now it doesn't work. It generates the template page and attaches it to an email, but the template page "Admin Use" is still "Read Only" when it shouldn't be. What's wrong with my script? Please help!

 

var a = this.getTemplate ("AdminUse");
a.spawn({bRename: false});
this.getField("Submit").display = display.hidden;
this.getField("Reset Form").display = display.hidden;
//getField("Text_Field").readonly = true;
for(var i=0;i<this.numFields;i++)
{
var fieldName = this.getNthFieldName(i);
if (fieldName == "Date_reviewed"
&&fieldName == "Date_Reported"
&&fieldName == "Designated-Recipient_Name"
&&fieldName == "Principal-Party-informed_Notice has been received"
&&fieldName == "Witness contacted"
&&fieldName == "FOR_ADMINISTRATION_USE_ONLY-Additonal Comments")
{
//console.println(i+":no:"+fieldName);... used in the debugger
}
else
{
//console.println(i+":"+fieldName);... used in the debugger
getField(fieldName).readonly = true;
}
}

TOPICS
JavaScript , PDF forms

Views

356

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 , Aug 04, 2021 Aug 04, 2021

Change the && to ||

&& means and

|| means or

 

Votes

Translate

Translate
Community Expert ,
Aug 04, 2021 Aug 04, 2021

Copy link to clipboard

Copied

Change the && to ||

&& means and

|| means or

 

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
Explorer ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

It worked thank you. I do know that && means "and" and || means "or" but I don't understand why in this instance using "or" instead of "and" is correct. Would you be able to explain? I would appreciate it so I may better understand for next time.

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 ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

E.g. fieldName == "Date_reviewed"
&&fieldName == "Date_Reported"

 

This will be never true because a field has only one name.

 

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
Explorer ,
Aug 05, 2021 Aug 05, 2021

Copy link to clipboard

Copied

LATEST

I get it now. Thank you!

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