Skip to main content
Participant
May 11, 2020
Question

Type into a field that is set to auto-generate from a checkbox?

  • May 11, 2020
  • 1 reply
  • 444 views

Hello,

 

Is it possible to type into a field that is set to autogenerate information from a selected checkbox?

 

Example:

I have four checkboxes on page one of myy PDF that generate predermined phrases into a field located on page two. I'd like to add an additional field called 'Other'. I want the user to be able to type unrestricted information into the Other field and have the information generated in to the field on page two.

 

Below is the code I've applied to the field on page two. Is there anything I can add to get the desired results?

 

var a=""

 

if (this.getField("CB1").value == "Yes")
{
a="\u2610 Option One \n"
}

if (this.getField("CB2").value == "Yes")
{
a=a + "\u2610 Option Two \n"
}

if (this.getField("CB3").value == "Yes")
{
a=a + "\u2610 Option Three \n"
}

if (this.getField("CB4").value == "Yes")
{
a=a + "\u2610 Option Four \n"
}

event.value=a

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
May 12, 2020

Change your code to the following:

 

if (event.source && //^CB\d$/.test(event.source.name)) {
// rest of code goes here
}