Text color change for alert message
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2019 11:58 PM
Is it possible to change some part of text's color shown using alert message in catalog client script? like
alert("If you choose category as personal laptop, then you have to attach <font color='red'>email approval from your manager</font> with this request.");
I want only "email approval from your manager" in red color and rest will be as standard one.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 03:49 AM
My requirement is I have a variable(type) of select type. When I select value as "personal laptop" for a particular catalog then the alert message should be shown.
For this I have created a system ui> message where I have put the alert message with color for some text. This is fine.
Now on widget sc_cat_item, I want to show it. how to get the variable value and based on it show the alert?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 04:17 AM
My advice. Stop using alert and use SweetAlert.
It's freely available on Share and it's awesome:
https://developer.servicenow.com/app.do#!/share/contents/1320723_sweetalert_2?v=2&t=PRODUCT_DETAILS
Have a look at some examples here:
https://sweetalert2.github.io/
Regards
Paul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2019 05:07 AM
I used is catalog client script but it's not working
parent.swal("Any fool can use a <font color=\'red\'>computer</font>");