Hello @arnab28
For example, assuming you have the “Single Line Text” (fieldname1), and radio button field (fieldname2), and you want the “Single Line Text” to be read-only by default, and make it editable only if the checkbox is ticked.
First, select the “Single Line Text” field (fieldname1) and tick the “Read only” checkbox in its settings.
Second, insert an “HTML Content” field in the form with the following piece of code as its content:
<script>
jQuery(document).on('change', '[id*="fieldname2_"]', function(){
var readonly = !this.checked;
jQuery('[id*="fieldname1_"]').prop('readonly', readonly);
});
</script>
I’m sorry, but if you need additional customizations, I cannot help you through the WordPress forum. You must contact me through my private website:
Custom Coding Service
Best regards.