I have created a custom post type and I have a field with radio buttons. The client is asking for a "clear selection" button if the radio buttons are clicked by mistake. The radio buttons are not a required field and the client is afraid someone will click a radio button and not be able to correct the mistake.
I'm thinking of changing the radio buttons to checkboxes but there are already a lot of custom post type entries and I'm afraid I'll lose the radio button data if I change them to checkboxes.
Thanks in advance for your help.
John
hidden link
Hi John,
Thank you for contacting us and I'd be happy to assist.
There is no built-in feature available to add a clear/reset button for the radio field. To achieve this you can use some custom HTML and script.
Here is a useful discussion on the topic of using a custom script for this:
https://stackoverflow.com/questions/977137/how-to-reset-radiobuttons-in-jquery-so-that-none-is-checked
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar