- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2016 02:05 AM
how to get a popup window, where i can enter some text. onchange of some field?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-11-2016 02:46 AM
Please tell me where you are facing the issue, first you need to create a onChange client script with below code. Then make a UI page with name 'add_comments_dialog' and then add the code given in the link in HTML (section 4.2.1) and client script code (section 4.2.2) in the Client script part of UI page.
http://wiki.servicenow.com/index.php?title=Displaying_a_Custom_Dialog#gsc.tab=0
Mark Correct if it solved your issue or hit Like and Helpful if you find my response worthy.
onChange client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
commentsDialog();
function commentsDialog() {
//Get the values to pass into the dialog
var comments_text = g_form.getValue("comments");
var short_text = g_form.getValue("short_description");
//Initialize and open the dialog
var dialog = new GlideDialogWindow("add_comments_dialog"); //Instantiate the dialog containing the UI Page 'add_comments_dialog'
dialog.setTitle("Add Task Comments"); //Set the dialog title
dialog.setPreference("comments_text", comments_text); //Pass the comments into the dialog
dialog.setPreference("short_text", short_text); //Pass in a short description for use in the dialog
dialog.render(); //Open the dialog
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-22-2022 07:18 AM
Hi Deepa! Thanks for your support.
Could you copy and paste here the HTML code and the ClientScript code? Because I cant access to the page that you shared.