how to make fields ''ReadOnly'' in client script onSubmit.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:52 AM
how to make field
how to make fields ''ReadOnly'' in client script onSubmit.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:55 AM
Hi,
I would rather suggest to use a UI policy for making fields readonly
For making readonly through client script you can use this g_form.setReadOnly()
GlideForm (g form) - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:57 AM
Hi Kishore,
Can you explain the use case for this requirement ?
By the time you will make the fields read only the user would have already updated the fields.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 12:59 AM
g_form.setReadOnly('fieldname',true); // set read only
g_form.setReadOnly('fieldname',false); // unset read only field
Regards,

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2017 01:25 AM
Why would you want to make read only after submit? Whats the use case? I would prefer ACL in this case
Harish