Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Using Radio Buttons to change text in PDF

New Here ,
Jun 01, 2023 Jun 01, 2023

Greetings,

Please forgive me if this has been asked and answered.  I am currently working in Adobe Designer (complete newbie) and I am sure I need javascript to accomplish the following:  I have two radio buttons (1) Purchaser and (2) Contractor; there are multiple references throughout the document that should change to either "Purchaser" or "Contractor" depending on which of the radio buttons is selected. 

NOTE:  The radio buttons are grouped (porc)

NOTE:  Script exists but not working and I am attempting to remedy as this form is needed.

 

The following is the javascript present when looking at the radio button "group" in design mode:

 

form1.Page1.sect1.porc::change - (JavaScript, client)
 
if (this.rawValue == "1") {
xfa.resolveNode("form1.Page1.sect2.contractorTxt.value.#text").value = "Purchaser";
xfa.resolveNode("form1.Page1.sect3.Name.caption.value.#text").value = "Name of Purchaser";
xfa.resolveNode("form1.Page1.sect3.Address.caption.value.#text").value = "Address of Purchaser";
xfa.resolveNode("form1.Page1.sect3.City.caption.value.#text").value = "City of Purchaser";
xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Purchaser";
xfa.resolveNode(“form1.Page1.nonCorporate.Name[0].caption.value.#text”).value = Name of Purchaser”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[1].caption.value.#text”).value = Street Address of Purchaser”;
xfa.resolveNode(“form1.Page1.nonCorporate.Name[1].caption.value.#text”).value = Name of Purchaser”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[0].caption.value.#text”).value = Street Address of Purchaser”;
xfa.resolveNode("form1.Page2.Corporate.contractorTxt.value.#text").value = "Purchaser";
xfa.resolveNode("form1.Page2.Corporate.contractorTxt2.value.#text").value = "Purchaser";
//xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Purchaser";
}
else {
xfa.resolveNode("form1.Page1.sect2.contractorTxt.value.#text").value = "Contractor";
xfa.resolveNode("form1.Page1.sect3.Name.caption.value.#text").value = "Name of Contractor";
xfa.resolveNode("form1.Page1.sect3.Address.caption.value.#text").value = "Address of Contractor";
xfa.resolveNode("form1.Page1.sect3.City.caption.value.#text").value = "City of Contractor";
xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Contractor";
xfa.resolveNode(“form1.Page1.nonCorporate.Name[0].caption.value.#text”).value = Name of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[1].caption.value.#text”).value = Street Address of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Name[1].caption.value.#text”).value = Name of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[0].caption.value.#text”).value = Street Address of Contractor”;
xfa.resolveNode("form1.Page2.Corporate.contractorTxt.value.#text").value = "Contractor";
xfa.resolveNode("form1.Page2.Corporate.contractorTxt2.value.#text").value = "Contractor";
//xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Contractor";
}
 
 
 form1.Page1.sect1.porc.purc::change - (JavaScript, client)
 
if (this.rawValue == "1") {
//xfa.resolveNode("form1.Page1.sect2.contractrTxt.text.value.text").value  = "Purchaser";
//xfa.resolveNode("form1.Page1.sect.proxysign").presence = "visible";
//xfa.resolveNode("form1.Page1.claimantSignature.Employee_Certify.caption.value.#text").value = "I certify that this claim is true and correct to the best of my knowledge and belief and that the claimant has not received reimbursement for these expenses.";
}
else {
xfa.resolveNode("form1.Page1.sect2.contractorTxt.value.#text").value = "Contractor";
xfa.resolveNode("form1.Page1.sect3.Name.caption.value.#text").value = "Name of Contractor";
xfa.resolveNode("form1.Page1.sect3.Address.caption.value.#text").value = "Address of Contractor";
xfa.resolveNode("form1.Page1.sect3.City.caption.value.#text").value = "City of Contractor";
xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Contractor";
xfa.resolveNode(“form1.Page1.nonCorporate.Name[0].caption.value.#text”).value = Name of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[1].caption.value.#text”).value = Street Address of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Name[1].caption.value.#text”).value = Name of Contractor”;
xfa.resolveNode(“form1.Page1.nonCorporate.Address[0].caption.value.#text”).value = Street Address of Contractor”;
xfa.resolveNode("form1.Page2.Corporate.contractorTxt.value.#text").value = "Contractor";
xfa.resolveNode("form1.Page2.Corporate.contractorTxt2.value.#text").value = "Contractor";
//xfa.resolveNode("form1.Page1.sect3.SignatureField2.caption.value.#text").value = "Signature of Contractor";
}
 
Please provide detailed instructions, as I am new to javascript and the Adobe Designer interface.

Any assistance you can provide would be greatly appreciated.

Thanks in advance.

~J

 

 

TOPICS
How to , JavaScript , PDF forms
387
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Try the forum for the Designer. 

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jun 01, 2023 Jun 01, 2023

Try the forum for the Designer. 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jun 01, 2023 Jun 01, 2023
LATEST

Thank you, I located the AEM group.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines