Skip to main content
Inspiring
December 7, 2017
Answered

Start cursor in a specific field when pdf is opened

  • December 7, 2017
  • 2 replies
  • 922 views

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?

This topic has been closed for replies.
Correct answer SIPRNet11

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


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

2 replies

Bernd Alheit
Community Expert
Community Expert
December 7, 2017

and remove character ';' on line 1 and 3

try67
Community Expert
Community Expert
December 7, 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).

SIPRNet11Author
Inspiring
December 7, 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();

}

SIPRNet11Author
Inspiring
December 7, 2017

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