I need to allow the user to specify a value on creation but once created I need to disallow editing of that value.
code: 123 value: abc
User can enter both values on creation. But only ‘value’ is editable.
Using jqGrid and forms to do this.
Using this configuration:
{name:'code',index:'code', width:50,editable:true,editoptions:{maxlength:"20", readonly: 'readonly'},formoptions:{label:'Code'}, editrules:{required:true}},
{name:'value',index:'value', width:100,editable:true, editoptions:{maxlength:"400"},formoptions:{label:'Value'}, editrules:{required:true}},
But this is not allowing me to create the ‘code’ entry.
Thanks in advance.
As I didn’t get any answers I used
$("#code").attr('readonly', false);
$("#code").attr('readonly', true);
at appropriate locations, and that did it.
I also removed readonly: ‘readonly’ from editoptions above.