Need a Catalogue Client Script To Make a Mandatory Single Text field To Read Only based on Condition
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 07:55 AM - edited 04-04-2024 07:56 AM
Need a Catalogue Client Script To Make a Mandatory Single Text field To Read Only based on Condition (True or False on a Check Box selection)
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-04-2024 08:09 AM - edited 04-04-2024 08:09 AM
Try something like
var checkBoxField = g_form.getValue('check_box_field');
if (checkBoxField == 'true') {
g_form.setMandatory('single_line_text', false);
g_form.setReadOnly('single_line_text', true);
} else {
g_form.setMandatory('single_line_text', true);
g_form.setReadOnly('single_line_text', false);
}
Why are you not using UI policies?
Consider indicating the response as helpful and marking it as correct if it meets your needs.