Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Mystery text field?

Avatar

Level 1

On my form I have a text field(CustReason) set to invisible.  I have two radio buttons, one of the buttons sets the field to visible(CustomerSiteButton), clicking the other sets it invisible again. 

When using the form, I have clicked the 'visible' radio button and typed in to the now visible text field. 

I email submit via button to PDF.  I receive PDF but the text box is invisible.

To test the issue, I have replicated only the buttons and box on a blank form and the box works fine.  I even copy and pasted the working set to the non-working form but then it doesn't work, again.  What could possibly be causing this?

My scripts;

form1.#subform[0].RadioButtonList[2]::change - (JavaScript, client)

if (this.rawValue == 2) {

     CustReason.presence = "visible";

     CustReason.mandatory = "error"

} else {

     CustReason.presence = "invisible"

}

form1.#subform[0].Button1::click - (JavaScript, client)

if (form1.execValidate() == true)

{

form1.access = "open";

EmailSubmitButton1.execEvent("click");

}

else

{

   app.alert("You have not completed all of the required fields on the form. \n \nFields highlighted in Orange are mandatory. \n \nPlease complete the required fields.", 3);

}

form1.#subform[0].RadioButtonList[2].CustomerSiteButton::click - (JavaScript, client)

//+ GENERATED - DO NOT EDIT (ID:B1D76B02-780D-4DBB-82B5-3375EBC5ADAB CRC:3316702557)

//+ Type: Action

//+ Result1: SetFieldValue("$Node2","tonull","")

//+ Node2: form1[0].#subform[0].CustReason[0]

//+ Node1: form1[0].#subform[0].RadioButtonList[2].CustomerSiteButton[0]

//+ Condition1: RadioButton("$Node1","click")

//+ ActionName: CustomerSiteButton.click

this.resolveNode("CustReason").rawValue = null;

//-

1 Reply

Avatar

Level 2

Did you set the text field to be invisible when the form is initialised?

i.e. in form1::initialize - (JavaScript, client)

Whenever you open the PDF, it will then revert to being invisible, because it is initialising again.

Another thing to try is giving your subforms and radio button lists proper names, because although it works it is always much happier with direct references and can occasionally throw up problems.

form1.mysubform.myRBL::change - (JavaScript, client) instead of

form1.#subform[0].RadioButtonList[2]::change - (JavaScript, client)

These are the two things I would try first!

Good luck