Skip to main content
New Participant
November 1, 2024
Answered

Button to clear form and move to top

  • November 1, 2024
  • 2 replies
  • 514 views

I currently have a form with a button to clear all fields. Is there a way to have this button also move to the top of the form, or at least to the first field?

This topic has been closed for replies.
Correct answer PDF Automation Station

You want the button field itself to move, or the focus to move to the first field?  If you want the button to move you have to change the rect property in the script.  If you want the focus to move use this script in the button:

this.getField("TheField").setFocus();

The field can be hidden and placed anywhere on the page, or you can use an existing field.

2 replies

New Participant
November 1, 2024
Sorry if I was not clear. I would like the button to clear all fields, and move focus to the first field.


Regards,

[Image]
Robert Wallis
Executive Support Analyst, Business Operations Office
California Privacy Protection Agency<>
(916) 905-5476 | robert.wallis@cppa.ca.gov
PDF Automation Station
Community Expert
November 1, 2024

That's what I thought.  See my edited answer.

PDF Automation Station
Community Expert
November 1, 2024

You want the button field itself to move, or the focus to move to the first field?  If you want the button to move you have to change the rect property in the script.  If you want the focus to move use this script in the button:

this.getField("TheField").setFocus();

The field can be hidden and placed anywhere on the page, or you can use an existing field.