Redirect after 'window.alert'

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

08 Sep 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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

08 Sep 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:

Code: Select all

alert("sometext");
Cheers

User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

09 Sep 2017

Thanks!

By removing the window part of the script solved my issue.

Thanks for prompt reply!

Vegard!

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests