Need to disable the SAVE and CLOSE buttons in toolbar on a form

Will be using a submit button at the bottom of the form instead

I grabbed this from the documentation but it is not disabling them.

//disable buttons
fd.toolbar.buttons[0].disabled = true;
fd.toolbar.buttons[1].disabled = true;

I'm missing something, please advise - and thank you

Hi @Pandra,

It's recommended to put all code into the spRendered() function because some objects need time to initialize after the form is loaded. Try changing your code to this:

fd.spRendered(() => {
    fd.toolbar.buttons[0].disabled = true;
    fd.toolbar.buttons[1].disabled = true;
});

If this doesn't help, please share screenshots of the browser console (F12).

Thank you! I knew I was forgetting something important. Much appreciated.

1 Like