Skip to content
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

How do I validate forms with Semantic-UI-React #678

Closed
VanessaRLewis opened this issue Oct 14, 2016 · 10 comments
Closed

How do I validate forms with Semantic-UI-React #678

VanessaRLewis opened this issue Oct 14, 2016 · 10 comments
Labels

Comments

@VanessaRLewis
Copy link

I couldn't find documentation for Form Validation on http://react.semantic-ui.com and was hoping someone could point me in the right direction.
Has Form Validation been implemented yet in Semantic-UI-React? If so, are there any usage documents I can look at? If not, do I use normal Semantic UI's form validation or something like formsy-react?
I did look at the RFC: Form Validation #407 (#407) but it seemed like proposals for ideal Form Validation & Form Component.

@levithomason
Copy link
Member

levithomason commented Oct 14, 2016

Not yet implemented, see #407 for the latest convo. For now, you'll have to roll your own validation.

@shahidmau
Copy link

+1

@mairh
Copy link

mairh commented May 27, 2017

For you own validation I can recommend Redux Form. It integrates nicely with Semantic-UI-React. If you need an example I can create a gist for you.

@TrebuhD
Copy link

TrebuhD commented Jun 12, 2017

@mairh I would love to see said example!

@mairh
Copy link

mairh commented Jun 12, 2017

@TrebuhD Here you go https://gist.github.com/mairh/233f6b4ffdbaaed8ec75bb0bef087e8f

I tried to explain things as clearly as I could and also divided the code into separate components so that it reusable thought the codebase. You still have to define the redux-form in your reducers. (I have omitted that part since it is redux specific - Not related to redux-form or semantic-ui-react

@dondre
Copy link

dondre commented Sep 30, 2017

I just bite the bullet and installed forms.js and jquery. This validation was too good to pass up.

@levithomason
Copy link
Member

Just know it will break as soon as React replaces one of the DOM nodes on render. jQuery event listeners will be attached to the old DOM node.

I would highly recommend using one of the react libs and implementations suggested in #407.
There are many great solutions there.

@dondre
Copy link

dondre commented Sep 30, 2017

That won't happen as I'm writing to the document body. I actually had to add a check to prevent the script from duplicating on re-renders.

I really like this form-validation, I hope you guys can implement something similar.

@doanhuudung
Copy link

image
Waiting for validation's feature 💃

@levithomason
Copy link
Member

@doanhuudung Good news, that feature was shipped in 2016 :)

Semantic-UI-React !== Semantic-UI

The React port (this repo) is jQuery free for the reasons noted. The original repo is a jQuery based implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants