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

Start cursor in a specific field when pdf is opened

Participant ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

I have a PDF form set up that when someone opens it, the cursor is set in a specific field.  My form has to be signed four times so it's passed around.  I'm trying to set it up where each time a part of the form is completed and passed on to the next person, they open the form and the cursor is set up in their part.  Here's what I have right now set up in Page Properties Action tab but it's not working:

if this.getField("Sig One").value = "";{

getField("Date").setFocus();

} else if (this.getField("Sig One").value != "" && this.getField("Sig Two") = "";{

getField("Sup Name").setFocus();

and so on.  What am I doing wrong?

TOPICS
Acrobat SDK and JavaScript , Windows

Views

468

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

Participant , Dec 07, 2017 Dec 07, 2017

After removing the ';' it all came together nicely!!! Thanks everyone!

Votes

Translate

Translate
Community Expert ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

A couple of things.

First of all, you're using the wrong operator. The "=" operator assigns a value. The comparison operator is "==".

In addition, the condition after the if-statement must be placed within parentheses, which you didn't do in either one of your if-statements (lines 1 and 3).

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
Participant ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

ok thanks.  I did the full code and it's giving me a syntax error at line 4:

if (this.getField("Sig: One").value == "");{

getField("Date (YYYYMMDD)").setFocus();

} else if (this.getField("Sig: One").value != "" && this.getField("Sig: Two").value == "");{

getField("Sig: Two").setFocus();

} else if (this.getField("Sig: One").value != "" && this.getField("Sig: Two").value != "" && this.getField("Sig: Three").value == "");{

getField("Name: 3").setFocus();

} else if (this.getField("Sig: One").value != "" && this.getField("Sig: Two").value != "" && this.getField("Name: 3").value != "");{

getField("Name: Five").setFocus();

}

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
Participant ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

Nevermind,  I didn't see Bernd Alheit's comment before submitting.

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
Participant ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

LATEST

After removing the ';' it all came together nicely!!! Thanks everyone!

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 ,
Dec 07, 2017 Dec 07, 2017

Copy link to clipboard

Copied

and remove character ';' on line 1 and 3

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