Git Product home page Git Product logo

Comments (3)

ljharb avatar ljharb commented on June 19, 2024

Can you provide an example of what you intend? The entire purpose of widgets is for that to be the mechanism for customizing a field, instead of having to do it in your template.

from forms.

kokujin avatar kokujin commented on June 19, 2024

I have several forms in my application, but just one template to render them all. I would like to make the changes depend on CSS and markup values in the template than to make the changes in all the forms.

from forms.

ljharb avatar ljharb commented on June 19, 2024

I'm not sure I understand. To render a form using this module, you just call .toHTML() on the form object. If you have a special CSS class you want applied to email fields, then you can make your own email widget that calls the default one, and then extends it with your own CSS classes. Then, the form container in the template's CSS markup can use these form field classes to style things however you like.

Can you provide a JSFiddle that illustrates what you're trying to do? Based on my current understanding, your use case doesn't fit what this module does - ie, the form object should contain knowledge of how to both validate it, and entirely render it. What template it's in doesn't and shouldn't matter.

from 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.