Need to populate the alert on the form level
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 02:49 AM
Hi All,
I am working on the on of the form in this form I have requirement link when on Submit of the form I need to display the alert and form is not getting submitted(need to restrict the form submission only alert need to display when user click on the submit button)
I tried like below, in the alert message I have URL as well but I am getting error like below when I trying to save the onSubmit script.
Please any one provide me the input,
Thanks,
Vinuth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 03:19 AM
I tried like below and it's working fine
function onSubmit() {
//Type appropriate comment here, and begin script below
var urlString = "https://techtoc./non-functional/security/application-security/static-application-security-testing/sn...";
alert(" terminating on April 1, 2024 and all SAST/SCA has transitioned to . All GitHub and ADO repositories are already being scanned. Please login at https://snyk.com to start reviewing your scan results. You can review onboarding documentation here:"+" "+urlString);
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-16-2024 03:49 AM - edited 02-16-2024 03:50 AM
Hi @vinuth v
Try adding this logic...
var link = '<a href="URL_HERE">TEXT TO BE Displayed</a>';
var message = gs.getMessage('TEXT_IN_ALERT') + ' ' + link + ' ';
gs.addInfoMessage(message);
Please mark as helpful or if its resolved the issue, CORRECT!
Andrew Robinson
ServiceNow Developer