0
RadioButton Javascript click event not working for a PDF in TCPDF
New Here
,
/t5/acrobat-discussions/radiobutton-javascript-click-event-not-working-for-a-pdf-in-tcpdf/td-p/14868208
Sep 18, 2024
Sep 18, 2024
Copy link to clipboard
Copied
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
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more
Community Expert
,
LATEST
/t5/acrobat-discussions/radiobutton-javascript-click-event-not-working-for-a-pdf-in-tcpdf/m-p/14868283#M479329
Sep 18, 2024
Sep 18, 2024
Copy link to clipboard
Copied
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.
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
Learn more

