ptrw pro asked 7 years ago


Its not clear to me how to use MDB select. I have tried many different things including the use of the initialization script. Can you please post a complete example of where to put the initialization script and how to call the div styles correctly. I also dont see which files in "pro" are essential to the implementation of this. Thanks for your time.

ptrw pro answered 7 years ago


Thank you i was able to get it to work using your code. Appreciated very much.

Marta Wierzbicka staff answered 7 years ago


Hi, code like here doesn't work in your project?
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>Material Design Bootstrap</title>
    <!-- Font Awesome -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
    <!-- Bootstrap core CSS -->
    <link href="css/bootstrap.css" rel="stylesheet">
    <!-- Material Design Bootstrap -->
    <link href="css/mdb.css" rel="stylesheet">
    <!-- Your custom styles (optional) -->
    <link href="css/style.css" rel="stylesheet">
</head>

<body>

<!--Main Layout-->
<main>

    <!--Grid row-->
    <div class="row">
    
        <!--Grid column-->
        <div class="col-lg-4 col-md-12">
    
            <!--Blue select-->
            <select class="mdb-select colorful-select dropdown-primary">
                <option value="1">Option 1</option>
                <option value="2">Option 2</option>
                <option value="3">Option 3</option>
                <option value="4">Option 4</option>
                <option value="5">Option 5</option>
            </select>
            <label>Blue select</label>
            <!--/Blue select-->

    
        </div>
        <!--Grid column-->
    
    </div>
    <!--Grid row-->

</main>
<!--Main Layout-->

<!-- SCRIPTS -->
<!-- JQuery -->
<script type="text/javascript" src="js/jquery-3.1.1.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript" src="js/tether.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript" src="js/bootstrap.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="js/mdb.js"></script>
<!--Custom scripts-->
<script>

 // Material Select Initialization
 $(document).ready(function() {
    $('.mdb-select').material_select();
  });

</script>

</body>
</html>


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

  • ForumUser: Pro
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags