Adding a URL link within an onSubmit Catalog Client Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 12:36 AM
I've got a catalogue item where an alert message appears when certain options are selected. I've created an OnSubmit Catalog Client Script for this and applied the following code:
function onSubmit() {
//Type appropriate comment here, and begin script below
var rhsCategory = g_form.getValue('target_state_rhs_category');
var rhsSubCategory = g_form.getValue('target_state_rhs_sub_category');
var rhsStrategicStatus = g_form.getValue('u_strategic_status');
var link ='<strong><a href="https://lbg.service-now.com/kb_view.do?sysparm_article=KB0074291" target="_blank">KB0074291</a></strong>';
if (rhsCategory == 'Reimagine' && rhsSubCategory == 'Replace') {
return confirm ("The combination for RHS Category/RHS Sub - Category you have selected does not align with the selected Strategic Status. Please review your selection for strategic status and RHS. See Toxic Combinations List in " + link + " for conflicting RHS and Strategic Status combinations.");
}
if (rhsCategory == 'Hold' && rhsSubCategory == 'Strategic') {
return confirm ("The combination for RHS Category/RHS Sub - Category you have selected does not align with the selected Strategic Status. Please review your selection for strategic status and RHS. See Toxic Combinations List in " + link + " for conflicting RHS and Strategic Status combinations.");
}
}
I'm wanting the alert to show KB0074291 as the link and to open in a new windows. However, when a user clicks submit if those two conditions are met, the it displays the following:
I was just wondering what I need to do to stop the html from showing. Also, how do I replace the title 'lbgdev.service-now.com says' to something more appropriate?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 12:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2023 01:01 AM
That example you sent is for an onChange client script. Mine is onSubmit