Topic: Custom Validate input
Daniel Braun pro premium priority asked 8 years ago
<div class="md-form">
<i class="fa fa-envelope prefix"></i>
<input type="email" id="form9" class="form-control validate">
<label for="form9" data-error="wrong" data-success="right">Type your email</label>
</div>
thanks paolo.guerra answered 8 years ago
<input type="text" onfocusout="myFunction()">
I hope this is what you need.
Regards. Kamil Paciepnik answered 8 years ago
<div class="md-form">
<i class="fa fa-envelope prefix"></i>
<input type="email" id="form9" class="form-control validate">
<label for="form9" data-error="Your Text" data-success="right">Type your email</label>
</div>
If this is not what you need. Please describe the problem better and I will help you.
Regards Daniel Braun pro premium priority answered 8 years ago
Function validateInput() {
If (text is wrong) {
display(data-error);
}
}
I want to write my own validator like validating the length.
I know if it's a error it triggers data-error message but what I would like to know how does it trigger it?
Thanks jerrytunin pro answered 7 years ago
Rafał Rogulski answered 7 years ago
data-error
and data-success
with a message content, all showing is doing in CSS. When you add to input class valid
then a success message is shown, when invalid
then error.
Remove validate
class from input to turn off default validation.
Regards xzesstence pro answered 5 years ago
its so typical for mdb that important stuff is unanswered.. this is so annyoing and people are paying for this...
you don't even have this with good open source...
both thumbs down @ mdb... as so often... i don't have so many thumbs to vote down this ....ing ..it!
Marta Szymanska staff pro premium commented 5 years ago
Hi,
would you explain where is exactly the problem? The most helpful would be if you create a snippet showing the problem here: https://mdbootstrap.com/snippets/. Someone from our staff will help you, but please, specify your problem.
Best, Marta
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No