Filling form data using a button

Community Beginner ,
Jan 27, 2019

Copy link to clipboard

Copied

I am attempting to fill multiple form entries (mostly text boxes, some drop-downs) using a button.

The button is correctly resetting the hidden fields which generate the required random numbers, but attempting to change other field values is where it's breaking.

I'm using:

this.form.elements("Fel_Roll").value=Fel;

I've also tried

this.getField("Fel_Roll").value=Fel;

Fel is holding the random number and Fell_Roll is the field I want to have it input into IF the button is pressed.

I have also attempted it without the reset function, simply using the values currently in the (will be) hidden fields.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Check the JS Console (Ctrl+J) after clicking the button...

TOPICS
Acrobat SDK and JavaScript, Windows

Views

171

Likes

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

Filling form data using a button

Community Beginner ,
Jan 27, 2019

Copy link to clipboard

Copied

I am attempting to fill multiple form entries (mostly text boxes, some drop-downs) using a button.

The button is correctly resetting the hidden fields which generate the required random numbers, but attempting to change other field values is where it's breaking.

I'm using:

this.form.elements("Fel_Roll").value=Fel;

I've also tried

this.getField("Fel_Roll").value=Fel;

Fel is holding the random number and Fell_Roll is the field I want to have it input into IF the button is pressed.

I have also attempted it without the reset function, simply using the values currently in the (will be) hidden fields.

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Check the JS Console (Ctrl+J) after clicking the button...

TOPICS
Acrobat SDK and JavaScript, Windows

Views

172

Likes

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
Jan 27, 2019 0
Adobe Community Professional ,
Jan 27, 2019

Copy link to clipboard

Copied

Any error in the Javascript console?

Likes

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
Reply
Loading...
Jan 27, 2019 0
Most Valuable Participant ,
Jan 28, 2019

Copy link to clipboard

Copied

Post your full code, please, or (better yet) share the actual file with us (via Dropbox, Google Drive, etc.), please.

Likes

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
Reply
Loading...
Jan 28, 2019 0
Community Beginner ,
Jan 28, 2019

Copy link to clipboard

Copied

Dark_Heresy_Sheet_3p_Editable.pdf - Google Drive

There you go. It's the "Roll All" button on the top left.

Likes

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
Reply
Loading...
Jan 28, 2019 0
Most Valuable Participant ,
Jan 28, 2019

Copy link to clipboard

Copied

Check the JS Console (Ctrl+J) after clicking the button...

Likes

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
Reply
Loading...
Jan 28, 2019 1
Community Beginner ,
Jan 28, 2019

Copy link to clipboard

Copied

Wow, yeah, I'd messed up a couple variables. Thanks ^_^

Likes

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
Reply
Loading...
Jan 28, 2019 1