Forum Discussion

LijaHarris's avatar
LijaHarris
Qrew Trainee
2 years ago

Code Page Submit Button Redirects to Webpage with Record ID

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