- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 12:26 AM
I have an On Change Client script to redirect catalog item to a new URL when a field is not blank and do not allow form submit. Currently its redirecting in the same page, but I want the URL to open in new tab and do not allow form to submit in portal.
Below is my On Change Client Script
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
if (newValue != ''){
var html = "Please click Ok to request aceess for the selected Application";
var c = this;
c.test = "OK";
if (html) {
spModal.open({
title: 'Message Alert' ,
message: html,
buttons: [
{label:'OK', primary: true}
],
}).then(function(test) {
top.window.location= (newValue);
});
}
var redirectURL = 'newValue';
}
}
Could anyone help in getting this done!
Solved! Go to Solution.
- Labels:
-
Service Portal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 12:33 AM
Hi,
Try like this.
var url = newValue;
top.window.open(newValue,"_blank");
Mark the comment as a correct answer and also helpful if this solves the problem.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 12:33 AM
Hi,
Try like this.
var url = newValue;
top.window.open(newValue,"_blank");
Mark the comment as a correct answer and also helpful if this solves the problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 01:23 AM
Hi Asif,
Thanks for your response!
It worked to redirect page in new tab but its allowing form submit later which I don't want.
Link should open in new page and form submit should be aborted. Is it possible please?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 01:31 AM
Aha okay.
return false;
add this line after that redirection and check once.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2020 01:37 AM
HI Asif,
Tried it, but did'nt work