GithubHelp home page GithubHelp logo

Comments (9)

Unlink avatar Unlink commented on July 23, 2024

I don't understand your use case, why you need sometimes send warning and sometimes error? What is the difference between error and warning, in both cases is form invalid or how is it?

from forms.

juniwalk avatar juniwalk commented on July 23, 2024

Hi, use case could be for example sign up form, if user exists I can send message on the username input with bootstrap warning color. It's matter of choice of how to handle my forms.

from forms.

JanTvrdik avatar JanTvrdik commented on July 23, 2024

I don't get. If the username is already taken, it should be error, not a warning.

from forms.

juniwalk avatar juniwalk commented on July 23, 2024

Alright bad example. Look - all I would like is to have same flashMessages implemented for forms too. It would add to consistency and give use more power over how we handle our forms.

from forms.

Unlink avatar Unlink commented on July 23, 2024

Yes, but i don't think that there is a reason, when you need something else than error in forms.
Field is valid or not. That's something different like a flash messages, their purpose is notify user about something (success, fail, info...) but in form, we need to show only validation errors.
I can't imagine use case, when is needed something else than error.

from forms.

juniwalk avatar juniwalk commented on July 23, 2024

I see, well if giving us a choice is not good enough then I don't have anything else to say.

from forms.

Majkl578 avatar Majkl578 commented on July 23, 2024

This sounds like a valid use case for client-side code (e.g. password is not strong enough as a warning), but I don't see any benefit in server-side validation...

from forms.

juniwalk avatar juniwalk commented on July 23, 2024

Frankly I have no idea how client-side works, I am not that into javascript.

from forms.

jtojnar avatar jtojnar commented on July 23, 2024

This would be nice to have. Currently, I am building custom Rules instance and attaching it to a data-form-warning-rules attribute:

jtojnar/entries@601b203#diff-4078d83a9a0ef325c67991359ddfe536R73

Then I handle it in JavaScript:

jtojnar/entries@601b203#diff-20ca0a4947ea7c1006cda82eca50397c

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.