Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

Retaining changes from radio button events in submitted PDF

Avatar

Former Community Member

I have a form where radiobutton selections change the font in several textfields. It works perfectly when filling out the form.  When the form is submitted, I want those textfields to retain the font formatting that was selected by the user.

What I get instead  - the radio button shows up selected but the fields show up in the default font. I have to actually click on the button again to get the correct font to display -that won't work for what I am trying to do.  It appears that happens because the script runs in a click event.  I have tried it in other events, but to no avail.  Any help would be appreciated.

Here is the javascript for one of the radio buttons.

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

xfa.resolveNode("ReturnAddress[0]").font.typeface = "Angelina";
xfa.resolveNode("ReturnAddress[0]").font.size = "14pt";
xfa.resolveNode("ReturnAddress[0]").para.lineHeight = "12pt";

xfa.resolveNode("Recipeintaddress[0]").font.typeface = "Angelina";
xfa.resolveNode("Recipeintaddress[0]").font.size = "14pt";
xfa.resolveNode("Recipeintaddress[0]").para.lineHeight = "12pt";

xfa.resolveNode("Note[0]").font.typeface = "Angelina";
xfa.resolveNode("Note[0]").font.size = "14pt";
xfa.resolveNode("Note[0]").para.lineHeight = "12pt";

xfa.resolveNode("#subform[6].ReturnAddress[1]").font.typeface = "Angelina"
xfa.resolveNode("#subform[6].ReturnAddress[1]").font.size = "22pt"
xfa.resolveNode("#subform[6].ReturnAddress[1]").para.lineHeight = "20pt"

xfa.resolveNode("#subform[6].Recipeintaddress[1]").font.typeface = "Angelina"
xfa.resolveNode("#subform[6].Recipeintaddress[1]").font.size = "22pt"
xfa.resolveNode("#subform[6].Recipeintaddress[1]").para.lineHeight = "20pt"

xfa.resolveNode("#subform[8].Note[1]").font.typeface = "Angelina"
xfa.resolveNode("#subform[8].Note[1]").font.size = "22pt"
xfa.resolveNode("#subform[8].Note[1]").para.lineHeight = "20pt"

3 Replies

Avatar

Level 10

Check in Form Properties->Defaults under Scripting that you have "Preserve scripting changes to form when saved" set to Automatically.

Avatar

Former Community Member

If that does not work you can check the status of the button when the form loads and set the fonts accordingly.

Paul