Form input data-error does not show.
See original GitHub issueFirst of all I would like to say how happy i am with this framework. It has provided me with many features I like to use. I would like to insert form errors on my contact form when it is not filled in correctly. Unfortunately, using the attributes data-error and data-success does nothing to the input and I have not seen an open issue on this yet.
I am using the following markup:
<i class="material-icons prefix">account_circle</i>
<input id="name" type="text" class="validate">
<label for="name">Name</label>
</div>
I am programmaticly adding the data-error="name is required"
once the form has not been filled in correctly. I have checked the javascript and I can see in the console that the data-error attribute is inserted into the corresponding label, but nothing changes. Adding the attributes natively also does not make any changes.
Please help me out. I will provide further information if needed.
Issue Analytics
- State:
- Created 8 years ago
- Comments:7 (1 by maintainers)
@Clemzd This code not work when change class of the field datefield to datepicker of materializecss, because the attribute data-error is present but it is not show in the frontend. I see that ::after is not present. Anyone know what happend with this? I’m trying to fix this, but we can solve it together easyly.
Sorry for my english.
You can see in the image that ::after in into the label Standard Field 2, but in the date field ::after is not present and I think that for that reason data-error is not present in the UI.
Hello guys,
Thank you @Clemzd, I use your code to implement a datepicker and select to test the data-error in these fields.
https://jsfiddle.net/ipereto/28maedmf/
@ronanversendaal, I hope this can help to everyone that require this type of validation with materializecss in your software.