1

Afternoon all,

Fairly simple one this one but one that seems to be beyond me today. SharePoint 2007 survey that I'd like to redirect once the user hits finish. I have a custom Thankyou.aspx page for this.

As the SharePoint 2007 survey forms don't appear to allow me to add web parts or edit the pages, I've embedded a SharePoint form control into a Web Part Page to give me more options.

JQuery is an option as it's installed in my local environment and I only have access to SharePoint Designer 2007 and client side dev.

Any pointers appreciated.

1

The following solution is based on the redirection from the empty page inserted into the end of a Survey form.

Solution:

  • Add Page Separator at the end of Survey list (see pic. below) in order to insert an additional empty page enter image description here
  • Embed the following JavaScript code into Survey edit form

Snippet: redirects from the last Survey page

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
    var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
        results = regex.exec(location.search);
    return results == null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
}


(function(){
   var fieldName = getParameterByName('FirstField');
   if(fieldName == "ID"){
          window.location.href = "/pages/thankyou.aspx";
   }    

})();
1
  • 1
    This'll need to be embedded via SPD I think. I'll put it in the PlaceHolder main and will test. Thanks for the snippet. – Steven D Andrews May 7 '14 at 12:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.