Forum Discussion

Ya_akovGoldberg's avatar
Ya_akovGoldberg
Qrew Trainee
7 years ago

Code page abort save

Is there any way, using javascript, in a code page to abort the save.

My current system is that I have a field in the form that is set to required. I then use the QuickBase API to check if certain records are in place, this lets me know whether or not the form should be able to save. I am using the $.get() method to call the API; I have also used the $.ajax() method, but I still have the same issue that those methods run after QuickBase starts to save the form and I need them to run first. Is there a way I could have them abort the save, if need be, or to force them to run at the time they are called, and not during the save process of QuickBase
  • A simple idea might be to re-frame your idea of aborting the save and just remove the save button from the page if they're not supposed to be saving. I'm not sure what method you're using to call your code, but if you're on the form it'll be much easier just to remove the button than trying to stop them from clicking save.

    If you add some jQuery and do: 
    $("#saveButton").hide()
    $(".IconOnly").hide()
    $("#footerSaveButton").hide()

    It'll remove the header and footer saves and arrows



    Chayce Duncan | Technical Lead
    (720) 739-1406 | chayceduncan@quandarycg.com
    Quandary Knowledge Base
  • I hadn't thought of removing the save button, that should hopefully work, thank you.