Question
RadioButton Javascript click event not working for a PDF in TCPDF
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.
