Livecode Wiki

Specifies whether the contents of a field can be selected and changed by the user.


set the lockText of <field> to {true | false}


set the lockText of the foundField to false

Use the lockText property to prevent users from changing the text in a field.

When a field's lockText property is false, the field can be edited: the user can select text, delete text, type, cut, copy, and paste. The cursor becomes an I-beam when the mouse pointer is over the field. When the user clicks in the field, no mouseDown, mouseUp, mouseStillDown, mouseDoubleDown, or mouseDoubleUp messages are sent. (However, if the user Control-clicks or right-clicks, these messages are sent regardless of the field's lockText setting.)

When a field's lockText property is true, the user cannot edit the contents of the field. The cursor does not change when the mouse pointer is over the field, and clicking the field sends all normal mouse messages to it. (A handler can change the contents of a field with the put command and can select text using the select command, regardless of the lockText setting.)

If a field's lockText and traversalOn properties are both set to true, the user can select text, but not change it, and can scroll within the field using the keyboard. If the lockText is true and the traversalOn is false, the user can neither select nor edit the field's text. If the lockText is false and the traversalOn is true, the field can be edited.

See also: put (command), mouseCharChunk (function), linkClicked (message), mouseDoubleDown (message), mouseDown (message), mouseStillDown (message), mouseDoubleUp (message), mouseUp (message), field (object), cursor (property), cantModify (property), listBehavior (property), allowInlineInput (property), properties (property), selected (property), traversalOn (property),