Forum Discussion
TylerBrezler
7 years agoQrew Cadet
Thanks! I should stress that my skills with javascript are limited to stuff I've copied from community posts here, so if you don't mind clarifying slightly how the script should look, that would be awesome.
Something like this?
var text Submit = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=XXXXXXXXXXXXXXXX" &
"&_fid_67= " &
"&_fid_61=True" &
"&_fid_81=";
var input = $("#tdf_81")[0].innerHTML;
var text SubmitAction = "javascript:$.get('" & $Submit & $input &"',function(){location.reload(true);});void(0);";
$SubmitAction
I wasn't sure if the var input belongs inside the javascript or outside as a regular variable. I'm also not sure what "#tdf_81" is calling but I'm assuming a specific field / my comment field?
You're right - I could have a dynamic form rule to add a space to fid 67, but since I also need the checkbox to be checked, I figured I could put both those things into one API call. I'm sort of just trying to figure out how much I can cram into a single button and what the possibilities are.
The workaround I've put in place in the meantime is two separate buttons. One that is a "save and keep working button" that stores the comment text, and then the next is the API call / reload button. If one button can do both things, that would be awesome.
Something like this?
var text Submit = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=XXXXXXXXXXXXXXXX" &
"&_fid_67= " &
"&_fid_61=True" &
"&_fid_81=";
var input = $("#tdf_81")[0].innerHTML;
var text SubmitAction = "javascript:$.get('" & $Submit & $input &"',function(){location.reload(true);});void(0);";
$SubmitAction
I wasn't sure if the var input belongs inside the javascript or outside as a regular variable. I'm also not sure what "#tdf_81" is calling but I'm assuming a specific field / my comment field?
You're right - I could have a dynamic form rule to add a space to fid 67, but since I also need the checkbox to be checked, I figured I could put both those things into one API call. I'm sort of just trying to figure out how much I can cram into a single button and what the possibilities are.
The workaround I've put in place in the meantime is two separate buttons. One that is a "save and keep working button" that stores the comment text, and then the next is the API call / reload button. If one button can do both things, that would be awesome.