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

Start cursor in a specific field when pdf is opened

Participant ,
Dec 07, 2017 Dec 07, 2017

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
983
Translate
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!

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

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).

Translate
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

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();

}

Translate
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

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

Translate
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
LATEST

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

Translate
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

and remove character ';' on line 1 and 3

Translate
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