Topic: MDB Select Dropdown Fields and Validations
support7
pro
asked 6 years ago
How do I get the select dropdown fields to accept validation? I've tried HTML5 and JQuery Validate, but nothing is taking hold.
Add comment
Adrian Sawicki
free
answered 6 years ago
Hi,
You can get access to options by :
$('.mdb-select').on('change', function(e){
console.log(e.target.options[e.target.selectedIndex].value);
console.log(e.target.options[e.target.selectedIndex].text);
})
When you have the value of chosen option you can make simple if statement to validate it.
Adrian
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Status
Specification of the issue
- User: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No
Tags