Welcome Guest, Not a member yet? Register   Sign In
[Solved] Capturing value from Listbox
#1
Wink 
(This post was last modified: 08-03-2018, 12:13 AM by davy_yg.)

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




Theme © iAndrew 2016 - Forum software by © MyBB