make the multi line text variable mandatory even if it has a default value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 04:26 AM
Hi Everyone,
Is it possible to make a multi line text variable mandatory even if it has a default value?
If yes is there any documentation that I can use as a reference.
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 04:36 AM
Hi @Codi ,
Yes , you can but you will need to write a Client script to handle the same.
Here is a Sample Script where you can use Onsubmit client script to set the fields mandatory if they are not changed by user
(change backend name of variables if needed)
function onSubmit() {
var field1 = g_form.getControl('summary'); //Get the 'Caller' field control
var field2 = g_form.getControl('description'); //Get the 'Short description' field control
if (!field1.changed) {
g_form.setMandatory('summary', true);
}
if (!field2.changed) {
g_form.setMandatory('description', true);
}
if (field1.changed && field2.changed) {
return true;
}
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2024 07:53 PM
Hi @Community Alums
When I try the script that you provided and test it, it allows me to submit even though the I didn't update the field.