Checkbox to remove mapped field information

Explorer ,
Sep 14, 2017

Copy link to clipboard

Copied

Hello! I have a form that maps in information from an outside source when opened.  This form is used for 2 separate functions - the first function is to change a name and the second function is to change an address.  I currently have the address mapped in so when the form opens the address is displayed.  However, i would like that information to DISAPPEAR or become hidden if the checkbox labeled "Address Change" is checked.  I figured out a way to make the previous name APPEAR if the name change checkbox is checked but i can't seem to figure out how to make information DISAPPEAR when a checkbox is checked.  Every code I seem to enter makes the address hidden when the form is produced; but if i check the Address Change checkbox and then UNCHECK it the information appears.  I don't want that.  I want the info to be there automatically unless that box is checked.  I'm semi new to creating forms and have 0 background or training with JavaScript (minus knowing a few programmers and annoying them by picking their brains all day).  I've been teaching myself how to write custom scripts for my forms by going on these forums and honestly, google.  So far I've been able to figure out everything that I've set out on except my latest conquest.  Any help would be appreciated!!

**There are actually 2 separate Address Fields that are independently mapped, but I'd like them both to disappear when the Address Change checkbox is checked

EDIT: I figured this out on my own by using the following script;

if (event.target.value=="Off") {

this.getField("Old_Name").value = "";

   

} else {

this.getField("Old_Name").value = this.getField("PRIMARY_PERSON_PE_NOTE_1_EXPLANATION").value;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

137

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

Checkbox to remove mapped field information

Explorer ,
Sep 14, 2017

Copy link to clipboard

Copied

Hello! I have a form that maps in information from an outside source when opened.  This form is used for 2 separate functions - the first function is to change a name and the second function is to change an address.  I currently have the address mapped in so when the form opens the address is displayed.  However, i would like that information to DISAPPEAR or become hidden if the checkbox labeled "Address Change" is checked.  I figured out a way to make the previous name APPEAR if the name change checkbox is checked but i can't seem to figure out how to make information DISAPPEAR when a checkbox is checked.  Every code I seem to enter makes the address hidden when the form is produced; but if i check the Address Change checkbox and then UNCHECK it the information appears.  I don't want that.  I want the info to be there automatically unless that box is checked.  I'm semi new to creating forms and have 0 background or training with JavaScript (minus knowing a few programmers and annoying them by picking their brains all day).  I've been teaching myself how to write custom scripts for my forms by going on these forums and honestly, google.  So far I've been able to figure out everything that I've set out on except my latest conquest.  Any help would be appreciated!!

**There are actually 2 separate Address Fields that are independently mapped, but I'd like them both to disappear when the Address Change checkbox is checked

EDIT: I figured this out on my own by using the following script;

if (event.target.value=="Off") {

this.getField("Old_Name").value = "";

   

} else {

this.getField("Old_Name").value = this.getField("PRIMARY_PERSON_PE_NOTE_1_EXPLANATION").value;

}

TOPICS
Acrobat SDK and JavaScript, Windows

Views

138

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
Sep 14, 2017 0
Explorer ,
Aug 13, 2018

Copy link to clipboard

Copied

EDIT: I figured this out on my own by using the following script;

if (event.target.value=="Off") {

this.getField("Old_Name").value = "";

   

} else {

this.getField("Old_Name").value = this.getField("PRIMARY_PERSON_PE_NOTE_1_EXPLANATION").value;

}

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...
Aug 13, 2018 0