Topic: Multiple Material Select issue and validation Issue
abelgriffen pro asked 7 years ago
Adrian Sawicki free answered 7 years ago
$('.exampleClas1').find('li')
and more if
statements. If you will need more help with it, feel free to ask.
Regards
abelgriffen pro answered 7 years ago
Adrian Sawicki free answered 7 years ago
.select-dropdown {
max-height: 200px !important; <-- you can modify max-height as much as you need
}
abelgriffen pro answered 7 years ago
Adrian Sawicki free answered 7 years ago
<form action="#">
<select class="mdb-select">
<option value="" disabled selected>Choose your option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
</select>
<label for="form6" >Example label</label>
<input id="submit" type="submit">
</form>
JavaScript:
$(document).ready(function() {
$('.mdb-select').material_select();
var validate = '';
var submit = $('#submit');
$('li').on('click', function() {
validate = this.innerText;
return validate;
});
submit.on('click', function(e){
if (validate != ''){
console.log(validate);
} else {
e.preventDefault();
console.log("prevent submit")
}
});
Normal required isn't working with Material Select and if you want a tooltip you can add it by JavaScript.
Regards
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
- ForumUser: Pro
- Premium support: No
- Technology: General Bootstrap questions
- MDB Version: -
- Device: -
- Browser: -
- OS: -
- Provided sample code: No
- Provided link: No