Redirect to external URL after new form submit

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
metrovan
Posts: 16
Joined: Fri Feb 10, 2017

20 Feb 2018

Hi,

I'd like to redirect the site to another domain after submit, how do I do that?

The following code doesn't work.

Code: Select all

fd.sourceFormParam('http://google.ca);

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

21 Feb 2018

Dear metrovan,
Unfortunately, it's not possible in just one step without passing the ID. Instead, you can create a new page on your site and redirect users to it, using the same code, just use URL relative to your domain:

Code: Select all

fd.onsubmit(function() {
    fd.sourceFormParam('/sites/site/subsite/SitePages/redirectToGoogle.aspx');
    return true;
});
Then, on this page, add Script Editor webpart with the following content, it will redirect you to Google:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
  <head>
    <title>Redirecting...</title>
    <meta http-equiv="REFRESH" content="0;url=http://www.google.ca">
  </head>
  <body>
  </body>
</html>
Cheers

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 15 guests