Comments (12)
You'll find that the markup is now a <ul>
contained inside a <fieldset>
. Personally, I agree with not generating the <form>
tag, submit button etc. My use case is on an fully AJAX app anyway, so I have no need to use form actions etc.
from backbone-forms.
It seems that recently backbone-forms started generating form tags again. So what's the expected way to have submit/cancel buttons now?
from backbone-forms.
There are a few options:
- Update the HTML templates with the buttons before the form closing tag
- Append the buttons after rendering
- Put the buttons outside the form and submit via Javascript. This is what I'm doing at the moment, but not an ideal solution if you want to gracefully degrade if Javascript isn't available.
We could also have an option to generate these buttons on render, any opinions on this?
from backbone-forms.
I just ran into this myself - I'm using the bootstrap dialog with the form in the main body and a separate div (for styling) containing the submit buttons. I use javascript to submit, but regardless of form actions, tabbing to the main button doesn't work by default and which reduces usability for keyboard users.
One fix is to manually wrap the dialog in a form, but then that's shadowed by the default form tag that's currently generated. The ideal solution for my use cases are:
- Easy option to override the default template on a form
- Standard use case of appending buttons after rendering
from backbone-forms.
I think buttons should be part of the template.
from backbone-forms.
Whatever the solution, also keep in mind auto-save solutions where there's no save buttons at all.
Not sure if graceful degradation matters for form submitting as much here considering JavaScript is required to render the form to begin with.
from backbone-forms.
When generating the form tags, it would be nice to be able to optionally apply class and id properties to the form tag. For instance when using the bootstrap templates, it would be ideal to be able to change the form class from the inline form style to the stacked form style.
I'm more than happy to implement this and do a pull request - but I'm curious if anyone has a vision for how this should be configured. Perhaps a form config property in addition to the schema property? It would seem that that button config could go into this as well.
Thoughts?
from backbone-forms.
In my opinion, I think it should be easier to include submit button and/or cancel. And handle those events too.
from backbone-forms.
Are there any new thoughts on this issue? I think it's really important to provide a option to insert a submit button!
from backbone-forms.
Buttons to the people!!! I need it. why i need to use a jQuery to inject them after rendering. also i found that sometimes I need text blocks in the form. Text block are: notes, explanation, disclaimer etc.
from backbone-forms.
It's pretty easy to include a button right now by just creating a shared form template that includes a submit button... you don't need to use jQuery to inject one.
from backbone-forms.
Yep the new templates system should make it easy to include buttons and text blocks
from backbone-forms.
Related Issues (20)
- Code mismatch between github and NPM registry HOT 2
- lodash 4.x support HOT 1
- itemToString does not escape values by default HOT 3
- Memory leak in Form.editors.List.setValue() HOT 7
- Form.Editor.validate() reads all form values for nothing HOT 2
- $ not declared in Form.validators
- Make list works with Backbone Collection
- 0.15.0 milestone HOT 2
- Select._getOptionsHtml/arrayToHTML is very slow
- Bootstrap 3 inline radio / checkbox items
- Disabling fields: use $.prop rather than $.attr
- submodule in npm HOT 1
- Cannot read property 'render' of undefined HOT 1
- Submitting the form by pressing "enter" on a Number editor doesn't work
- reasons bb-forms is still fixed to bb ~1.2? HOT 4
- form.commit({validate:false}) still validates individual fields HOT 6
- How do I load List editor with webpack/browerify? HOT 1
- Number cannot accept negative values HOT 1
- [QUESTION] Where I can find the CI service?
- setOptions not working in select editor when function is used.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.