-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow custom submitType #72
Comments
I would prefer if form blocks were only concerned with things relating to form blocks. This keeps things reusable. Your idea of allowing more than one event (or what you could fit inside a single event map) to submit the form is good, but I have yet to personally encounter a situation in which I need such functionality on the actual form block configuration. I would be happy to read more of your thoughts surrounding this, though, because the functionality would be trivial to add. It's probably not a good idea to manage the element-level events that could submit a form on the form block configuration with a more complex API. It won't scale well as you try to balance conflicting scenarios--adding more granular selectors or using To address your specific example--a better way for you to do it would be like this: // This would go on the template surrounding the form block instance.
Template.MyCustomFormContainer.events({
'change input': function(event, template){
template.find('form').submit();
}
}); Now your code is free from package-related hacks, and that special functionality is limited to just this instance where you need it. |
Thanks for your answer and for the final suggestion. I have encountered two cases where this proposal could be useful.
|
As far I understood, forms are submitted on 'submit' event or on enter pressed. However, it would be nice also to have these cases:
I found a hack that looks like this
It works, but the package should handle those cases imo. In addition, it would be nice to specify if triggering events are mutually exclusive or inclusive. In other words, a form is submitted on enter and on submit, but not on change input.
The text was updated successfully, but these errors were encountered: