Skip to main content
kd47716310
Participant
June 2, 2022
Question

Conditional form autofill script

  • June 2, 2022
  • 1 reply
  • 235 views

I'm trying to simplify a repetetive process with a form containing information on the first few pages that autofills into all the subsequent pages depending on the selection for each line of information.  

 

The data entered into the first part of the form is a list containing the following information in each line: case number, agency name, charge name, date, and outcome. These are all separate text boxes on one line.

 

For each line mentioned above, each line will have the option to select "expunge, seal, not eligible ever, or not eligible yet".

 

I want the form to place the line of information (case number, agency name, charge name, date, and outcome) into the appropriate spot on the pages that come later in the form. 

 

For example, if one line of incformation had "expunge" checked then I want that information to be filled out under the expunge list on 7,10, and 12. 

 

I'm not sure if I can add an action with a scrip to do this. I have no background in this area so have tried to figure it outmyself over the years but mostly give up and have to do repetetive data entry. I likely don't know relevant terms or other ways to describe what I'm trying to do but I thought it was worth a try to post this! Thanks!

 

This topic has been closed for replies.

1 reply

Nesa Nurani
Community Expert
Community Expert
June 3, 2022

Since you will be populating same info on pages 7,10 and 12 you can name those fields same, for example:

Page1 field name "Case Number"

Page7 field name "Case Number1"

Page10 field name "Case Number1"

Page12 field name "Case Number1"

Do the same for other fields too (agency name, charge name, date, and outcome)

Now as 'Mouse UP' event of checkbox 'expunge' use something like this:

if(event.target.value != "Off"){
this.getField("Case Number1").value = this.getField("Case Number").value;
this.getField("Agency Name1").value = this.getField("Agency Name").value;
//...etc
}
else{
this.getField("Case Number1").value = "";
this.getField("Agency Name1").value = "";
//...etc
}