Page 1 of 1

Create radio button and define the action for the radio button

Posted: Mon Dec 26, 2022 4:02 pm
by SmitaraniB
Hi Team,

How can I be able to create radio button and define the action for each of the radio button in java script file?

Thanks,
Smita

Re: Create radio button and define the action for the radio button

Posted: Fri Dec 30, 2022 10:32 am
by cristi_talau
Hello,

Out-of-the-box, Web Author offers some form controls that can be used to edit the value of an attribute. For example, oxy_popup displays a radio button that can be used to set the value of an attribute [1]. However, it does not perform a particular action when you select a value.
You have several options here:
  • Use oxy_popup and register an AuthorDocumentFilter using the Java API. The AuthorDocumentFilter can react to changes in the attribute value to perform your custom action
  • Use multiple oxy_button form controls to emulate the radio buttons. When pressing a button, change the element's attribute. You can use this attribute value in CSS to configure the appearance of the buttons
  • Implement a custom form control that does exactly what you want. [2]
Best,
Cristian

[1] https://www.oxygenxml.com/doc/versions/ ... ditor.html
[2] https://www.oxygenxml.com/maven/com/oxy ... ntrol.html