Forum Discussion
Hi Jeff,
I tried adding in my URL and although the "submit" button is working it's still not redirecting to the page I'd like. Here is my code, can you see if I've put something in wrong?
var text ButtonWords = "Submit";
var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=YOUR_APP_TOKEN"
& "&_fid_17="&"Submit";
var text URLTWO = "https://ruralhealth.health.utah.gov/hwac-thankyou/" & "db/" & AppID() & "?a=showpage&pageid=3";
var text URL =
$URLONE
& "&rdr=" & URLEncode($URLTWO);
// Begin button style
var text bgcolor = "#1AA1B7";
var text txtcolor = "white";
var text style = "style=\"text-decoration: none; width: 100px; text-align: center; background:" & $bgcolor & "; border-radius: 5px; padding: 8px 10px; color: " & $txtcolor & "; display: inline-block; font: normal 700 24px/1 \"Calibri\", sans-serif; text-shadow: none;";
// End button style
"<a " & $style & " href=" & $URL & ">" & $ButtonWords & "</a>"
Thank you!
Kendyl
------------------------------
Kendyl Brockman
------------------------------
What should happen when they submit? Is it meant to edit some part of a record? The URL1 variable is meant to edit the record in some way.
You need to update the code in var URLONE to do whatever is meant to happen when they press the button, then it will do that action and redirect to the thank you page.
var text URLONE = URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&rid=" & [Record ID#]
& "&apptoken=YOUR_APP_TOKEN"
& "&_fid_17="&"Submit";
In this case, the fid_17 is the field ID for MY field that holds the status, you might not have this, or yours is different.
------------------------------
Jeff Peterson
------------------------------