- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 03:21 AM
I'm using an input box with "var test = prompt("test");".
Is it possible to increase the input form of this input box to three?
I know that I can solve it by outputting the input box many times, but I want to implement input from three fields in one input box.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 04:09 AM
Hello,
If I understand it correctly, you would like to open a modal window with more fields.
If that's the case, you could use the spModal API as Paul mentioned. There is an example, which you can use to embed a simple widget into the modal window.
//HTML template
<button ng-click="c.onWidget('widget-cool-clock')" class="btn btn-default">
Cool Clock
</button>
//Client script
function(spModal) {
var c = this;
c.onWidget = function(widgetId, widgetInput) {
spModal.open({
title: 'Displaying widget ' + widgetId,
widget: widgetId,
widgetInput: widgetInput || {}
}).then(function(){
console.log('widget dismissed');
})
}
}
Best Regards,
István

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 03:26 AM
There isn't an OOB API for this exact requirement.
If you are working in the classic interface, you would have to create your own UI page and use the GlideDialog API.
If you are working in Service Portal, you could achieve this using the spModal API.
If you are working in Agent Workspace, you could achieve this using the g_modal API.
Perhaps we can assist further if you can mention the UI you are running this code from.
ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 03:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 04:09 AM
Hello,
If I understand it correctly, you would like to open a modal window with more fields.
If that's the case, you could use the spModal API as Paul mentioned. There is an example, which you can use to embed a simple widget into the modal window.
//HTML template
<button ng-click="c.onWidget('widget-cool-clock')" class="btn btn-default">
Cool Clock
</button>
//Client script
function(spModal) {
var c = this;
c.onWidget = function(widgetId, widgetInput) {
spModal.open({
title: 'Displaying widget ' + widgetId,
widget: widgetId,
widgetInput: widgetInput || {}
}).then(function(){
console.log('widget dismissed');
})
}
}
Best Regards,
István
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-31-2022 07:55 AM
I was able to implement it by creating a widget with multiple input boxes and configuring it!
thank you!