Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
99
rated 0 times [  100] [ 1]  / answers: 1 / hits: 123627  / 10 Years ago, sun, february 1, 2015, 12:00:00

I am currently working with materialize CSS and it seems I've gotten snagged with the select fields.



I'm using the example provided from their site but unfortunately it it's rendering in the view whatsoever. I was wondering if someone else might be able to help.



What I am trying to do is create a row with 2 end spacers that provide padding - then within the inner two row items there should be a search text input and a search select dropdown.



This is the example I'm working from: http://materializecss.com/forms.html



Thank you in advance.



Here is the snippet of code in question.



<div class=row>
<form class=col s12>
<div class=row>
<div class=input-field col s2></div>
<div class=input-field col s5>
<input id=icon_prefix type=text class=validate />
<label for=icon_prefix>Search</label>
</div>
<div class=input-field col s3>
<label>Materialize Select</label>
<select>
<option value= disabled=disabled selected=selected>Choose your option</option>
<option value=1>Option 1</option>
<option value=2>Option 2</option>
<option value=3>Option 3</option>
</select>
</div>
<div class=input-field col s2></div>
</div>
</form>



More From » html

 Answers
35

Because they override the browser default, the select styling needs Javascript to run. You need to include the Materialize Javascript file, and then call


$(document).ready(function() {
$('select').formSelect();
// Old way
// $('select').material_select();
});

after you've loaded that file.


[#68001] Friday, January 30, 2015, 10 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rocioblancac

Total Points: 699
Total Questions: 96
Total Answers: 108

Location: Libya
Member since Mon, Dec 7, 2020
4 Years ago
;