• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Capturing value from Listbox

#1
Wink 
Check this out:

views\email\blast.php


         <center>
                                <label for="input1">List Emails</label>
                                    <select name="listbox" id='pre-selected-options' multiple='multiple' size="7">

                                    <?php     
                                    foreach($email as $item){    
                                    
                                        echo '<option value="'.$item['email'].'">'.$item['email'].'</option>';                                   
                                        }                                    
                                    ?>
                                    </select>                                
          </center>     


controllers\email.php


       private function send_email($id){

             $this->load->model('EmailModel');

             // bikin to yg pake , nanti di explode
             $to = array();
             $to[] = $this->input->post('pre-selected-options');




I wonder if this line is correct:   $to[] = $this->input->post('pre-selected-options');

Supposing that many emails is being selected and I am trying to capture the value from the controller into $to[]  - how to do so?

Thanks in advance.
" If I looks more intelligence please increase my reputation."
Reply

#2
@davy_yg,

Is that a variable with a special character after it? Or is that suppose to be brackets?
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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