Need to create a dropdown field in ui page

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2021 11:02 PM
Please Urgent Requiremnet.......!!!!!!!!!!!!!!!!
Hello everyone,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2021 01:27 AM
Hi,
you can have onChange event on that select option and redirect
HTML:
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<html>
<style>
.color-class
{
color:red;
}
.color-blue-class
{
color:blue;
}
</style>
<p class="color-class">hello</p>
<p class="color-red-blue">Blue Color</p>
<g:evaluate jelly="true" object="true">
var inc = new GlideRecord('incident');
inc.setLimit(10);
inc.query();
inc;
</g:evaluate>
<select name="tables" id="selected1" onchange="redirect()">
<j:while test="${inc.next()}">
<option value="${inc.number}">${inc.number}</option>
</j:while>
</select>
</html>
</j:jelly>
Client Script:
function redirect(){
var url = '/navpage.do';
top.location.href = url;
}
Let me know if I have answered your question.
If so, please mark appropriate response as correct & helpful so that this thread can be closed and others can be benefited by this.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2023 07:42 AM
@Community Alums
Hope you are doing good.
Did my reply answer your question?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader