I am using PHP/Json data from MySQL to populate my jqGrid. I need to have certain fields read only on the edit form but then become editable on the add form. Oleg suggested a couple posts here and here but couldn't get it to work on my end.
See code below. I've tried to set the fields to readonly in the beforeShowForm event but none of them get set to readonly. What am I missing?
beforeShowForm: function (form) {
$('#div',form).attr('readonly','readonly');
$('#l1l3',form).attr('readonly','readonly');
$('#l2l3',form).attr('readonly','readonly');
$('#ExecBegin',form).attr('readonly','readonly');
$('#ExecEnd',form).attr('readonly','readonly');
}
Any suggestions would be appreciated!