If you use the AppGini readonly, then the field is only displayed, basically as a label. It's not an html form element. You can change the value that's displayed, but it's not saved when you save the form.
You can not set the AppGini readonly, then use jquery to add the readonly attribute to the form field. This allows the value to be updated, and the changes will be saved with the form. The problem I have with this is that the cursor can still enter the field and it remains in the tab order.
So, what do I use?
I use the pseudo-disabled technique I proposed:
Code: Select all
$j('#fieldname').prop('readonly', true);
$j('#fieldname').prop('tabIndex', -1);
$j('#fieldname').prop('style', 'cursor: not-allowed; background-color: #EEE;');
$j('#fieldname').mousedown(function(){return false;});
This makes the field readonly,
takes it out of the tab order,
prevents the cursor from entering the field (such as, by a mouse click),
changes the cursor when it moves over the field,
and alters the background color.
If you want to have the field look more like a label instead of a field, I'm sure you could tweak the style in that third .prop command.