Topic: MDB Select Dropdown Fields and Validations

support7 pro asked 5 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.

Adrian Sawicki free answered 5 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

Please insert min. 20 characters.

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