Make field mandatory using client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 01:25 AM
how to make filed mandatory and read only using client script instead of using UI policies.
Regards
Divya
- 32,854 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 01:29 AM
g_form.setMandatory('fieldname',true); // To make mandatory
g_form.setMandatoy('fieldname',false); //to make non-mandatory
g_form.setReadOnly('fieldname',true); // To make Readonly
g_form.setReadOnly('fieldname',false); //to make non-readonly
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 01:51 AM
Thank you Harish for your response.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-03-2017 02:37 AM
Np Divya. You can close the thread by marking appropriate answer..:)
Harish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2017 08:28 AM
Hello Harish,
I have a question. Suppose if I have more than 15 fields which should be visible and mandatory on Change of another field value, how can I make it mandatory? e.g., I have a select box field 'A' with choices 1-15. And I have around 15 other fields lets say (B-P), which should be visible and should be mandatory on change of field A's value. Also, as the choice increases the number of fields which should be visible also should increase. [e.g., If selected 1, then B field, if selected 2, then B, C fields, if selecetd 3, then B,C,D fields should be visible.. and so on....
Writing a client script with setMandatory and setVisible for each field is too long. UI policy is also I guess is not feasible.
Is there any other way to achieve this?