Forum Discussion
Okay, so I started to get this figured out I managed to pass a few values with the url portion. However, I dont know how to obtain the data from the current page and pass it along to the other page such as the [Record ID #] and other fields I need to obtain.
Code Page:
<!DOCTYPE HTML>
<html>
<body>
<script>
const dbid = 'btadwgxn9'; // REPLACE 'btadwgxn9' with your table DBID
const apptoken = 'c2x3rt7dkx56hnh9ckac49b2tz'; // REPLACE 'c2x3rt7dkx56hnh9ckac49b2tz' with your app token
const fieldValue = 'Work'; // REPLACE 'Work' with the desired value for fid 25
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;
}
};
const url = "https://" + window.location.hostname + "/db/" + dbid + "?a=API_AddRecord&apptoken=" + apptoken + "&_fid_25=Work" + "&_fid_16=In" ;
xhttp.open("POST", url, true);
xhttp.send();
</script>
</body>
</html>
<!-- THIS CODE NEED YOUR APPLICATIONS APP TOKEN AND TABLE DBID. UPDATE LINES 5 AND 6 ABOVE. -->
------------------------------
William Hunter
------------------------------