javascript - Why the values of checked elements from select control are not coming in $_POST array after submission of form? -
this question has answer here:
i've following html code:
<form action="rebates.php" role="form" method="post"> <select id="example28" multiple="multiple" name="applicable_states"> <option value="" selected='selected'>select unit</option> <option value="1" >alabama</option> <option value="2" >alaska</option> <option value="3" >arizona</option> <option value="4" >arkansas</option> <option value="5" >california</option> </select> <button type="submit" class="btn btn-primary">preview</button> </form>
the jquery code select control follows:
/*jquery code*/ $(document).ready(function() { window.prettyprint() && prettyprint(); $('#example28').multiselect({ includeselectalloption: true, maxheight: 150 }); });
i've used bootstrap's js , css (multiselect , prettify) achieve this. issue i'm not getting checked elements' values after submission of form in $_post array
oe rebates.php. can please me in regard? in advance. when check values select control , submit form i'm getting $_post
array follows:
array ( [applicable_states] => 11 [multiselect] => 11 )
why happening? code in rebates.php follows:
<?php print_r($_post); die; ?>
php needs know it's array. need change name of select.
name="applicable_states[]"
Comments
Post a Comment