Giter Site home page Giter Site logo

Comments (12)

mjtamlyn avatar mjtamlyn commented on August 21, 2024

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.

philfreo avatar philfreo commented on August 21, 2024

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.

powmedia avatar powmedia commented on August 21, 2024

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.

eslick avatar eslick commented on August 21, 2024

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:

  1. Easy option to override the default template on a form
  2. Standard use case of appending buttons after rendering

from backbone-forms.

svnlto avatar svnlto commented on August 21, 2024

I think buttons should be part of the template.

from backbone-forms.

philfreo avatar philfreo commented on August 21, 2024

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.

 avatar commented on August 21, 2024

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.

macool avatar macool commented on August 21, 2024

In my opinion, I think it should be easier to include submit button and/or cancel. And handle those events too.

from backbone-forms.

adius avatar adius commented on August 21, 2024

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.

mromanoff avatar mromanoff commented on August 21, 2024

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.

philfreo avatar philfreo commented on August 21, 2024

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.

powmedia avatar powmedia commented on August 21, 2024

Yep the new templates system should make it easy to include buttons and text blocks

from backbone-forms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.