When a calendar box field is set to un-editable, it still allows change of data via the calendar box.
editable refers normally to cursor based actions, enabled to all other.
But we could change this behaviour, want more developers this?
Changing the behaviour is one direction to go in, Jan, but that depends upon how total the non editable property would become.
For example, I may want to stop direct cursor based actions on a field but still allow some programmatic modification of the data !
In the original example cited I make the assumption that the field in question is allowed access at some point so that a user can choose a date via the calendar popup - else why format it as a calendar box !?
If this is the case and the field property is then changed to non editable after data entry or some other criteria then could it not be more useful to be able to change the display type of the field from a calendar box to a text_field so you are in control of both these field properties ?
I agree with Harry
if you want the field non-editable, make it a text-field instead of a calendar-field.
You can use the method: elements.fieldname.enabled = false
than the complete field (incl datechooser) is disabled.
True, the enabled property will provide what I need to protect the field, the only problem I have with using it is that the content is grey-ed out. Harry is correct, I need to allow input into this field under some circumstances, and protected in others.
My only other work-around to this problem is to define the field twice, once as an enabled combobox and again as an un-editable text field and switch them with the visible property, but this doubles the number of fields on the form and requires more method code to switch functions.
I would offer the following suggestions:
- ability to set the foreground color of an enabled=false field so that the field could appear enabled and non-editable, or
- ability to change fields display type within a method.