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

RadioButton Javascript click event not working for a PDF in TCPDF

New Here ,
Sep 18, 2024 Sep 18, 2024

If anyone can help, I'd appreciate it. I have created a simple form using TCPDF. The javascript for the click event for a radiobutton control is not working. I'd like to fill the text box with the value of the checked radio button. There are 4 radio buttons 

 

My code so far is:

 

To display the radiobutton controls:

$pdf->RadioButton('r_zcct', 5, array(), array(), '27', true, $x, $y, false);
$pdf->RadioButton('r_zcct', 5, array(), array(), '30', true, $x, $y, false);
$pdf->RadioButton('r_zcct', 5, array(), array(), '35', true, $x, $y, false);
 

To display the target textbox control:

$pdf->TextField("textbox_1", 30, 3, array(), array(), $x, $y);
 
The text field does get the default value of the radio buttons with this javascript:
this.getField("textbox_1").value = this.getField("r_zcct").valueAsString;
 
I just don't know how to code the javascript to detect when a different radio button is checked and then fill the textbox with the radio button's value.
 
I tried everything like if(this.getField("r_zcct").isChecked){}, but nothing seems to work. 
 
Thank you for all your help.
 
TOPICS
Create PDFs , How to , JavaScript , PDF , PDF forms
147
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 ,
Sep 18, 2024 Sep 18, 2024
LATEST

It's very likely this application doesn't support the full JS specs. There's nothing we can do about that. Complain to its developers.

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