Forum Discussion

AnneTheisen's avatar
AnneTheisen
Qrew Trainee
7 years ago

Save and Redirect to a Thank You Page

I am trying to allow "everyone on the internet" to update a record, save, and be redirected to a Thank You page. There is a lot of information out there about how to do this, I've tried a few version but none seem to redirect successfully. 

I started with the code below from "ABC Customer Tracking" youtube video

"<a class='Vibrant Success' onclick='DoSaveAdd()' href='#'><img src=\"/i/clear2x2.gif\" " &

"onload=\"javascript:if(typeof QBU=='undefined'){QBU={};$.getScript('" &

URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=save.js&rand='+Math.random())}\">Submit</a>"


And tried a few options suggested in the Community

1) URLRoot() & "db/" & Dbid() & "?a=dbpage&pageID=5"

2) URLRoot() & "db/" & Dbid() & "?a=dbpage&pagename=ThankYou.html}\">Submit</a>"


I am not a programmer and only good at "insert your blah blah here" so I'm struggling to adapt what I read to the base I've started with (which is probably 10 years old now?)

Appreciate any help you can provide.  

Thanks

17 Replies

  • I reached out to Kirk Trachy at quickbase and he was able to solve my problem.  In my "save.js" page, I was redirecting based on adding a new record when in fact I was editing an existing record.  So, this code for the save.js page will do both.

    Thanks again for all your help in trying to solve this problem - greatly appreciated!


    (function(){
      var querystring=document.location.search;

      if (/nwr/i.test(querystring)) {

        $("#RedirectURL").val(gReqAppDBID+'?a=dbpage&pagename=ThankYou.html&ifv=20');
        $("input[name=rl]").val("");

      }

     else if(/a=er/i.test(querystring)) {
      
    $("#RedirectURL").val(gReqAppDBID+'?a=dbpage&pagename=ThankYou.html&ifv=20');
        $("input[name=rl]").val("");
     
      }

    })();

    //This page is loaded automatically by using a variation of Dan Diebolt's image unload technique where a transparent image
    //located within the "Submit" button field is displayed thus pulling this page.
    //The if test above only will change the RedirectURL if nwr is contained within the URL.