• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mutiselect one value selected

#1
[eluser]boytun[/eluser]
Hello
In my application I create a standard multiselect field , but when I click the submit button, I get a single value in my controller.
Very strange to me, Normally I get a table that contains the values ​​that I selects in the form.
this is the html's tag's of the multiselect fields:

Code:
<select multiple="multiple" name="pages">
<option value="Nouveau" archive="">Nouveau archive</option>
<option value="Acceuil">Acceuil</option>
<option value="Portfolio" selected="">Portfolio</option>
<option value="Web" design="">Web Design</option>
<option value="Contact">Contact</option>
<option value="About">About</option>
</select>

and this how I get the values from the form:
Code:
$data3['val']=$this->input->post('pages');
echo "<pre>".var_dump($data3)."</pre>";exit;

when I select more than one value I get the last value selected:
Quote:array(1) { ["val"]=> string(9) "Portfolio" }

Please help me.

#2
[eluser]jairoh_[/eluser]
try changing
name="pages"
into
name="pages[]"


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.