angular icon indicating copy to clipboard operation
angular copied to clipboard

Need to remove default submit button in form builder

Open dolphinsd opened this issue 6 years ago • 3 comments

When new form is built, how to disable automatically adding 'submit' button in a new form?

We would like to start from a blank form without submit button.

Passing defaultTemplate = { display: 'form', components: [] }; creates submit button.

it would be nice if the code below would not be default behavior: /**

  • Adds a submit button if there are no components. */ addSubmitButton() { if (!this.getComponents().length) { this.submitButton = this.addComponent({ type: 'button', label: this.t('Submit'), key: 'submit', size: 'md', block: false, action: 'submit', disableOnInvalid: true, theme: 'primary' }); } }

dolphinsd avatar Aug 08 '19 17:08 dolphinsd

This is not a bug but works as designed. If you would like to include a configuration to not include this, then please feel free to add a pull request.

travist avatar Aug 13 '19 14:08 travist

{ noDefaultSubmitButton: true } is added to FormDesigner options meantime.

merobal avatar Nov 07 '19 12:11 merobal

For any who might be use custom JS in the Form Module, here is what the JSON needs to look like. The setting goes in the first "builder" node, not the second "builder" node.

{
    "options": {
        "builder": {
            "noDefaultSubmitButton": true,
            "builder": {
                "resource": false,
                "advanced": false,
                "premium": false,
                "data": false,
                "layout": false
            }
        }
    }
}

jarednlivingston avatar Aug 18 '22 17:08 jarednlivingston

We're currently addressing a backlog of GitHub issues, and as part of this effort, some inactive issues may be marked as closed. This isn't a dismissal, but a step toward more efficient tracking.

If you feel the issue is still relevant, please re-open and we'll ensure it gets the attention it deserves. Your understanding is appreciated as we work to enhance our open-source responsiveness.

Sidiro23 avatar Feb 07 '24 14:02 Sidiro23