Trouble with non text fields

Ok... this code works:


$('#view_48 #field_6').attr('disabled', true); 


It prevents the editing of a text field on a form.


The code will not work if the field is a multiple choice or date field.


Does anyone know what the code would be to prevent editing of a multiple choice or date field on a form?


What attribute am I trying to change?


Thanks, for your help.



Wouter

Hi Wouter,

You can use the following CSS code to disable a dropdown field input. Replace the ## with your forms view_#, this will affect all these field types on the form though, you would need to target the specific field if there are multiple dropdowns:

Connection field dropdown:

#view_## .chzn-container{pointer-events:none;}

MC field dropdown:

#view_## .kn-select{pointer-events:none;}

Try $('#view_48 #field_6').attr('disabled', 'disabled');