1// In your HTML:
2<form method="post">
3 <select class="select2" name="listbox[]" multiple="multiple">
4 <option value="One">One</option>
5 <option value="Two">Two</option>
6 <option value="Three">Three</option>
7 <option value="Four">Four</option>
8 </select>
9 <input type="submit" name="btn" value="Get the Records">
10</form>
11
12// In your Javascript (external .js resource or <script> tag):
13$(document).ready(function() {
14 $('.select2').select2();
15});
16
17// In your PHP
18
19<?php
20
21 if (isset($_POST['btn']) && $_SERVER['REQUET_METHOD']==="POST") {
22 $items = $_POST['listbox'];
23 foreach ($items as $item) {
24 // Run SQL Query or do any other action
25 echo $item.'<br>';
26 }
27 }
28
29?>
1<form action="ResultsDulith.php" id="intermediate" name="inputMachine[]" multiple="multiple" method="post">
2 <select id="selectDuration" name="selectDuration[]" multiple="multiple">
3 <option value="1 WEEK" >Last 1 Week</option>
4 <option value="2 WEEK" >Last 2 Week </option>
5 <option value="3 WEEK" >Last 3 Week</option>
6 <option value="4 WEEK" >Last 4 Week</option>
7 <option value="5 WEEK" >Last 5 Week</option>
8 <option value="6 WEEK" >Last 6 Week</option>
9 </select>
10 <input type="submit"/>
11</form>
12