Need to remove default submit button in form builder
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' }); } }
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.
{ noDefaultSubmitButton: true } is added to FormDesigner options meantime.
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
}
}
}
}
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.