Discussions

 View Only
Expand all | Collapse all

Code Page Submit Button Redirects to Webpage with Record ID

  • 1.  Code Page Submit Button Redirects to Webpage with Record ID

    Posted 08-26-2022 16:51
    So I have a code page that is client facing so when the user hit submits (the submit button) I would like them to be directed to another webpage (code page) that in the URL holds the newly created record id.  Below is some of the code: The xxxx are placeholders

    </table><input type=hidden name=rdr value='https://xxxxxxxx.quickbase.com/db/xxxxxx?a=dbpage&pageID=2'>
    <input type=submit value=Submit>

    ideally the value should be: "https://xxxxxxxxxxxxx.quickbase.com/db/xxxxxxxx?a=dbpage&pageID=2" + "&rid=" + rid

    Here is the java code:

    $.ajax({url: "xxxxxxxxxxx?act=API_AddRecord",
    type: 'POST',
    data: req1,
    contentType: "text/xml",
    dataType: "xml",
    processData: false,
    success: function(data, status, xhr) {
    var _rid = $(data).find('rid');
    var rid = _rid[0].innerHTML;
    var customRedirectURL = "https://xxxxxxxxxxxxxx.com/db/xxxxxxxxxxxxx?a=dbpage&pageID=2" + "&rid=" + rid;
    window.location.href = customRedirectURL;

    ------------------------------
    Lija Harris
    ------------------------------


  • 2.  RE: Code Page Submit Button Redirects to Webpage with Record ID

    Posted 08-27-2022 12:19
    Hello. Evaluate the response param in succes function.

    success : function (response) 
                alert("The server says: " + response);

    You can see the new ID.