How to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.
Community Alums
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2024 02:18 PM
Hi,
In record producer, I want to make ‘attach file’ as mandatory when claim damage request is selected as ‘Yes’.
Regards,
Sanju
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2024 05:27 AM
Hi @Community Alums
You can write a onSubmit catalog Client Script like below :-
function onSubmit() {
if ((g_form.getValue('<variable_name>') == 'yes') &&
this.document.getElementsByClassName('get-attachment').length == 0) {
g_form.addErrorMessage(getMessage('Attachment is mandatory when Claim Damage Request is Yes.'));
return false; // Prevent form submission
}
}