How to add an info message to a field selection
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 04:14 PM
I need help creating a Catalog Client Script to show an info message when a variable is set to yes.
*will contractor require a laptop? If yes, I'd like to show an info, warning or error message, under the field to show a msg "You must attach an approval email from the director of talent acquisition".
value - ctr_requires_laptop
Any help you could be provide would be greatly appreciated.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2024 05:31 PM
You can do this with an onChange Catalog Client Script when this variable changes. The script would look something like this:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue == 'yes') { //replace with your variable Value
g_form.showFieldMsg("ctr_requires_laptop", "You must attach an approval email from the director of talent acquisition.", "error");
} else {
g_form.hideFieldMsg("ctr_requires_laptop");
}
}
It sounds like you will also want to make an attachment type variable mandatory at this time, or if you are not using a variable for this you can have an onSubmit Catalog Client Script that checks the attachment table for a record from this request and prohibits the submission if one is not present.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2024 09:23 AM
Thank you so Much Brad!