Skip to main content
Known Participant
November 4, 2020
Question

button to make an already automatically filled field go blank so that user can type in new info

  • November 4, 2020
  • 1 reply
  • 528 views

I have a multi-page form that uses the same information to fill in numerous blanks, specifically the user’s name. I have named all such fields  the same (“Name”) so that when the user fills in the first field all the others are also filled in.

 

However, there is one such blank where the user might want to occasionally leave the field blank or type in different information.

 

I am new to this, but I hae created a button the user can hit and make the one selected field go blank, allowing the user to then either leave it blank or type in  new information.

 

To do this I have cobbled together the following code:

 

  1. I changed name of  the field to be made changeable from “Name” to ““Name1”

 

  1. I created a field named “Hidden” that has a display of “Hidden”

 

  1. I put the following JavaScript in the calculate tab of “Name1”

 

if (this.getField

("Hidden").value.length== 0)

event.value = this.getField("Name").valueAsString

 

4          In the actions tab of the button I put the following two scripts

 

a)

 

this.getField

("Hidden").value

=

"Hidden"

 

b)

 

this.resetForm("Name1")

 

Surely to goodness there is a simpler, more straight forward way to do this. What is it? It's bothering me.

 

Thank you very much in advance for your assistance.

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
November 4, 2020

Post the question in the forum for Adobe Acrobat.

KYJudAuthor
Known Participant
November 4, 2020

Thanks. I have coppied the text of this post into a new post in the acrobate forum and am just about to hit Post. Is there a way to move this post?

Bernd Alheit
Community Expert
Community Expert
November 4, 2020

You can't move the post.