When trying to display Jquery Validation messages are labels the text box is disordered because Materilizecss puts all the labels as absolute. They can fix that problem, that is not so generic.
What validations are you using?
I use this plugin http://jqueryvalidation.org/
Hi Lopez, having same problem, did u ever find a solution?
Its impractical to change our style so that it tries to fit every validation plugin. Instead we will add some support for validation.
It is possible to use jquery-validation with materialize.
I made a little example here : https://jsfiddle.net/rz0zk5u6/2/
Hi @Clemzd I would like to know if u have edited materialize.min.css. I was checking your example, but I cant get how did you solved the data-error overlapping display. Thanks.
I've went with another approach with jquery validate, instead of injecting the error message in the data-error attribute, I create another label element after the label. Then place it with css
example:
http://codepen.io/anon/pen/aOQejJ
this is working with input-fields and textarea's, haven't tried it with checkboxes and switches, but it should be the same idea, just a bit tweaking of the css
thanks alot Clemzd & philipraets
philipraets m using ur solution in one of my projects thanks it's perfectly working.
but can yo implement in select boxes of materiaze selects or any solutions you have please state it thanks
@Clemzd
DUDE!!! YOU ROCK!!! i can't thank you enough for that Fiddle (@ https://jsfiddle.net/rz0zk5u6/2) - it saved me! ;-)
i have spent the last 3 days trying to figure out how to make the jquery-validate plugin integrate with materialize. i had finally gotten everything working except that error notification text. (obviously, i'm not a programmer) i've read'n'searched'n'read'n'searched'n'read SSOOOO much to no avail until just now when i found & 'read' this thread.
so basically, just wanted say a huge THANKS!!!
✌🏼
@Clemzd TNX!
Its impractical to change our style so that it tries to fit every validation plugin
@Dogfalo - true, yet we don't talk about "every validation plugin". Here we talked about jqueryvalidation.org, which is always the first thing that comes to mind when thinking about 'jQuery' and 'form validation'. Not to mention that it is also the first that comes to google's mind too. You could slim down 'materialise' of validation code and join the 'jqueryvalidation' bandwagon for that purpose. Would be a win-win, IMHO.
@Clemzd Were you able to get this to work with Select type drop downs? Thanks!
@Clemzd This not working with datepicker, i think the error label has hidden too with datepicker container.
@Dogfalo Maybe you can move datepicker container append to body ?
@Clemzd Are you releasing that fiddle under the same license as materialize?
@wahmal Not sure if you were having the same issue, but I was able to get validation to work with datepickers. See my comment here.
Any update on this?
Most helpful comment
It is possible to use jquery-validation with materialize.
I made a little example here : https://jsfiddle.net/rz0zk5u6/2/