So to answer / cover 3 topics from above -
#tdf_81 would ideally be the your field - yes. Its the unique identifier in the HTML that calls at that particular element.
As for the syntax - to follow the method if you are still shooting for a button - you can't declare another variable outside of your js invocation - it has be inside because its not a part of Quick Base formula syntax - but actual JS. So what I copied above was close to what you need - updated based on your inclusions above
var text submit = URLRoot() & "db/" & Dbid() & "?a=API_EditRecord" & "&rid=" & [Record ID#] &
"&apptoken=XXXXXXXXXXXXXXXX" &
"&_fid_67= " &
"&_fid_61=True" &
"&_fid_81=";
"javascript: {
var input = $("#tdf_81")[0].innerHTML;
$.get(' " & $submit & "' + input, function(data,success) { location.reload() } );
}"
In this case - when you start your javascript - step one is to grab the value from the page of field 81 using jQuery from inside of your actual JS. Step two - is to start your get, using your $submit Quick Base formula - but use it in a way that you can add the input from field 81. This is why the $.get looks like (I've added spacing to make it more clear
$.get( ' " & $submit & " ' + input, function...
Inside your get you're putting a url - which at its core is just a string. So you start it with what you already have with your $submit - and then since your still in Javascript syntax - you do a
+ input to tack on the variable that you used to store the value of fid 81
Hopefully that helps describe it a little better.
As for using form rules - couldn't form rules take care of your spacing and checking the box? I'm not sure what the exact workflow is - but it seems like this button might be a bit much for what you're trying. Have you considered something like having a checkbox instead of a button - or dropdown to confirm? When that is checked or a value is entered - form rule fires to check your box and add a space to your log field. Then they would just save as normal. Same thing could be done with automations too
Chayce Duncan | Technical Lead
(720) 739-1406 |
chayceduncan@quandarycg.com Quandary Knowledge Base