Passing data in a code page
Okay so I am a little rusty with HTML, but how do I pass information in this HTML code page?
Code Page:
<!DOCTYPE HTML>
<html>
<body>
<script>
const dbid = 'btadwgxn9'; <!-- NEED TO UPDATE THIS WITH YOUR TABLE DBID -->
const apptoken = 'c2x3rt7dkx56hnh9ckac49b2tz'; <!-- NEED TO UPDATE THIS WITH YOUR APP TOKEN -->
const xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
const response = this.responseXML;
const redirectUrl = "https://" + window.location.hostname + "/db/" + dbid + "?a=er&rid=" + response.getElementsByTagName("rid")[0].textContent+"&rl=bbv";
location.href = redirectUrl;
}
};
xhttp.open("GET", "https://" + window.location.hostname + "/db/" + dbid + "?a=API_AddRecord&apptoken=" + apptoken, true);
xhttp.send();
</script>
</body>
</html>
<!-- THIS CODE NEED YOUR APPLICATIONS APP TOKEN AND TABLE DBID. UPDATE LINES 5 AND 6 ABOVE. -->
Prior to this code page I was just passing the information with a URL API call as such:
API Call
var text urlone=
URLRoot() & "db/" & [_DBID_TIME_ENTRIES] & "?a=API_AddRecord&apptoken=c2x3rt7dkx56hnh9ckac49b2tz&_fid_13=" & URLEncode ([Record ID#]) & "&_fid_18="
& URLEncode ([User's Name]) & "&_fid_25=Work" & "&_fid_104=" & URLEncode ([Supervisor])& "&_fid_105=" & URLEncode ([Foreman]) & "&_fid_106=" & URLEncode ([Job Start Time])
//& URLEncode ([Current Users Record - Maximum Record ID# User]) This line of code was dropped from the other code. It passed an alternative field.
& "&_fid_16=In" & "&_fid_7=" & Now() & "&rdr=" & URLEncode("https://lmisystemsinc-6511.quickbase.com/db/btadwesdf/849d5088-6a1f-4ef9-a535-28c2f94bcd0b?a=showpage&pageIdV2=32602166-99b0-4ce6-9f36-5de9252afe1c");
However, long story short, this is a method I need to use in certain situations. None the less I do not know how to pass that information with an HTML code page as I was in the prior method if someone could please help.
------------------------------
William Hunter
------------------------------