Please enable JavaScript to view this site.

Navigation: Advanced topics > Programming topics > JavaScript API > Control object > Methods

JavaScript API: Control object > makeReadonly()

Scroll Prev Next More

 

Makes the control readonly.

Syntax

ctrl.makeReadonly();

Arguments

No arguments.

Return value

No return value.

Example

Make the control readonly using the JavaScript OnLoad event:

 

var ctrl = Runner.getControl(pageid, 'Make');
ctrl.makeReadonly();

Remarks

Note: Readonly controls are submitted with the form and saved in the database. Readonly controls will be filled by the Autofill feature. You can apply default values to Readonly controls.

 

Making a control readonly is not a security measure, it is simply a UI feature. If you need to prevent these fields from being saved, use this code in Before record added/Before record updated events:

 

unset( $values['FieldName'] );

See also:

JavaScript API: Control object > getControl()

JavaScript API: Control object > isReadonly()

JavaScript API: Control object > makeReadWrite()

JavaScript API: Control object > reset()

JavaScript API: Control object > getValue()

Events: JavaScript OnLoad

JavaScript API: Control object

JavaScript API

 

Created with Help+Manual 7 and styled with Premium Pack Version 3 © by EC Software