- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2020 03:45 AM
Hi,
1) I am trying to create a Modal popup which contains a URL as content.
2) When Modal is clicked on "Next" button, it should call a onClick function which is already present eg: OpenModal2();
I have written:
HTML
====
<button ng-click="openModal1()" class="btn btn-primary">Modal1</button>
<button ng-click="openModal2()" class="btn btn-primary">Modal2</button>
Client Script
=============
function() {
/* widget controller */
var c = this;
$scope.openModal1= function() {
var url = '<br><a ng-href= "https://community.servicenow.com/" >Accessories</a>';
spModal.open({
title: 'Accessories',
message: 'Would like to add accessories.?' + url,
buttons: [{
label: i18n.getMessage("Next")
}],
}).then(function($scope) {
openModal2();
})
}
openModal2() = function() {
spModal.confirm("Would like to add softwares.?");
}
}
Any suggestions would be really helpful. ThankYou.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2020 05:35 AM
Hi Mohammed,
Try this.
// HTML template
<button ng-click="c.onConfirm()" class="btn btn-default"> Confirm </button>
// Client script
function() {
var c = this;
$scope.openModal1= function() {
var url = '<br><a href= "https://community.servicenow.com/" >Accessories</a>';
spModal.open({
title: 'Accessories',
message: 'Would like to add accessories.? ' + url,
buttons: [{
label: i18n.getMessage("Next")
}],
}).then(function($scope) {
spModal.confirm("Modal -2 ");
})
}
}
Refer this: LINK
Thanks.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-21-2020 09:23 AM
Below solutions should be helpful to you
https://serviceportal.io/modal-windows-service-portal/
https://community.servicenow.com/community?id=community_question&sys_id=f6c22232db9817042e247a9e0f9619e1
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2020 05:35 AM
Hi Mohammed,
Try this.
// HTML template
<button ng-click="c.onConfirm()" class="btn btn-default"> Confirm </button>
// Client script
function() {
var c = this;
$scope.openModal1= function() {
var url = '<br><a href= "https://community.servicenow.com/" >Accessories</a>';
spModal.open({
title: 'Accessories',
message: 'Would like to add accessories.? ' + url,
buttons: [{
label: i18n.getMessage("Next")
}],
}).then(function($scope) {
spModal.confirm("Modal -2 ");
})
}
}
Refer this: LINK
Thanks.