Custom buttons - visible but disabled

Hi,

I have a set of custom buttons to step through statuses, and wondered how I could change the background colour of the buttons, or have then be disabled but visible. .All buttons are type Success (green).

Button1 sets the status from "Created" to "Start", then that button is hidden and Button2 is shown.

What I would like is that Button2 is greyed out/disabled but visible until a field has been filled in.

Is that possible?

Dear @Nick.Jones,
Is it just a regular button? It can be disabled with the following:
fd.control('Button2').disabled = true;

You just need to track the field value and once its filled, set the button as not disabled:

fd.rendered(() => {
    function buttonDisableEnable() {
        if (fd.field('Status').value) {
            fd.control('Button2').disabled = false;
        } else {
            fd.control('Button2').disabled = true;
        }
    }

    // Calling buttonDisableEnable when the Status value changes
    fd.field('Status').$on('change', buttonDisableEnable);

    // Calling buttonDisableEnable on form loading
    buttonDisableEnable();
});
1 Like

Thank you, that works :slight_smile: