Skip to main content
Participant
5월 11, 2020 9:40 오후 UTC
공지사항

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

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

이 주제는 답변이 닫혔습니다.

1 답변

try67
Community Expert
Community Expert
5월 12, 2020 12:18 오후 UTC

Change your code to the following:

 

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

번역