Redirect after 'window.alert'
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
Hi!
I have included window.alert("sometext"); in the OnClick control in Forms designer. After clicking "OK" im beeing redirected from the current page. Using "_self" in the target control redirect me to the list itself.
Is there a way to stop the redirection?
Thanks,
Vegard
I have included window.alert("sometext"); in the OnClick control in Forms designer. After clicking "OK" im beeing redirected from the current page. Using "_self" in the target control redirect me to the list itself.
Is there a way to stop the redirection?
Thanks,
Vegard
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Hello, Vegard!
This technically shouldn't happen, are you sure there is no extra JavaScript somewhere on the page that does it?
If not, in order to replicate the issue we'll need to know what SharePoint you are using - Online or On-Premises 2010/13/16? Also, what's the browser that gives you this result? What is your version of Forms Designer? And finally, is it just a button where you add this code to OnClick event?
If you can, please also send us all the JavaScript included on the Form and on the page, so we could test this behavior. It might be caused by some other scripts you are running, but we can't be certain right now. Also, if you just need an alert message, why not remove window part? Or is it important for some other code on the page?
Try this and tell us the results:
This technically shouldn't happen, are you sure there is no extra JavaScript somewhere on the page that does it?
If not, in order to replicate the issue we'll need to know what SharePoint you are using - Online or On-Premises 2010/13/16? Also, what's the browser that gives you this result? What is your version of Forms Designer? And finally, is it just a button where you add this code to OnClick event?
If you can, please also send us all the JavaScript included on the Form and on the page, so we could test this behavior. It might be caused by some other scripts you are running, but we can't be certain right now. Also, if you just need an alert message, why not remove window part? Or is it important for some other code on the page?
Try this and tell us the results:
Code: Select all
alert("sometext");
Cheers
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
Thanks!
By removing the window part of the script solved my issue.
Thanks for prompt reply!
Vegard!
By removing the window part of the script solved my issue.
Thanks for prompt reply!
Vegard!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests