Expand my Community achievements bar.

Set Focus

Avatar

Level 7

Is it possible when user click on a button with the script(Paul help me with this) below the focus to be set into upcoming

Password required message window?

Thanks

var

flag = false;

while

(flag != true){

var CheckPW = xfa.host.response("Password required", "Comments", "", 1);

if (CheckPW == "123"){

form1.Only.presence

= "visible";

flag

= true;

}

else {

if (CheckPW == ""){

flag

= true;

}

else {

xfa.host.messageBox("Wrong Password, please try again!"

, "",0,0);

}

}

}

8 Replies

Avatar

Former Community Member

When the repsonse box comes up the cursor is already in the input field of the response box....or am I missing something?

Paul

Avatar

Level 7

Hi Paul,

Does not work for me!

Probably I am missing something.....

Thanks for your help

Avatar

Level 7

Someone can help me with this?

Thanks

Avatar

Level 7

The script for setting focus into a field is:

xfa.host.setFocus(insert path to field here);

Avatar

Level 7

Where I have to insert this line into my script above?

Thanks

Avatar

Level 7

I'd try putting it right after the message box error message.

Avatar

Former Community Member

xfa.host.setFocus(the_field_name.somExpression);

Avatar

Level 7

From Thomp:

Try changing the line where it is called to this:

var CheckPW = xfa.host.response("Password required", "Comments", "", 0);