Hello @mrmet86
Thank you so much for using our plugin. Please follow the instructions below.
Go to the DropDown field’s settings, tick the “Includes an additional first choice as placeholder” checkbox, and enter the text of first choice through the “First choice text” attribute.
Assuming the DropDown field is the fieldname123, insert an “HTML Content” field in the form and enter the following piece of code as its content:
<script>
fbuilderjQuery(document).on('formReady',function(){
getField('fieldname123').jQueryRef().find('option:eq(0)').prop('disabled', true);
});
</script>
Best regards.
Hello again. Is it possible to target the specific form and field name? This does not work when two forms are being used on the same page. I recreated the field with an id that is not used on the first form but this did not work either. (first form does calculations and the second form is a contact form) Thanks again.
Hello @mrmet86
Yes, that’s possible. Insert the form shortcode by passing a class name through its shortcode.
E.g.
[CP_CALCULATED_FIELDS id="1" class="form-a"]
Second, pass the form selector as the second parameter in the getField operation:
E.g.
<script>
fbuilderjQuery(document).on('formReady',function(){
getField('fieldname123', '.form-a').jQueryRef().find('option:eq(0)').prop('disabled', true);
});
</script>
Best regards.