Discussions

 View Only
  • 1.  Saving after checkbox updated

    Posted 05-21-2020 10:33
    I have a button that will check or uncheck a checkbox and redirects back to the original view.  I want to save before the redirect using 
    "javascript:DoSaveAdd()"​

    Where would I add that in the code below? 

    var text urlyes =
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=cgywnw8dk9cp2pciq46fd6hn9j3&rid=" & [Record ID#] & "&_fid_3134=1";
    var text urlno =
    URLRoot() & "db/" & Dbid() & "?act=API_EditRecord&apptoken=cgywnw8dk9cp2pciq46fd6hn9j3&rid=" & [Record ID#] & "&_fid_3134=0";
    
    
    If(not [Submit All],
    "<a class=\"Vibrant Secondary\" style=\"width:200px; text-align: center; color: #fff;\" href=\"javascript:" & "$.get('" & $urlyes &
    "',function(){" & "location.reload();" & "});" &
    "void(0);\">MS Not All Services Submitted</a>",
    "<a class=\"Vibrant Success\" style=\"width:200px; text-align: center; color: #fff;\" href=\"javascript:" & "$.get('" & $urlno &
    "',function(){" & "location.reload();" & "});" &
    "void(0);\">MS All Services Submitted</a>")​


    ------------------------------
    Paul Peterson
    ------------------------------


  • 2.  RE: Saving after checkbox updated

    Posted 05-21-2020 15:27
    Now I'm even more confused than before.  I tried adding the save command inside the function and in a couple other places.  I some instances the javascript appeared to run, but the checkbox was not checked.  Even after removing the save command the checkbox is not checked when the button is clicked even though the code is the same as it was before trying to add the save command.

    ------------------------------
    Paul Peterson
    ------------------------------