Welcome Guest, Not a member yet? Register   Sign In
submit button dont responding
#1

[eluser]penta997[/eluser]
Hi. I have weird problem with submit button. When i click on it, is happen nothing. It is not responding. This is my controller witch displays a view:
Code:
function index()
    {


       //wyswietla wszystkie ksiazki
        $widok['tytul'] = 'Przeglądaj zamówienia';
       $config['base_url'] = 'http://lukaszbielecki.cba.pl/ksiegarnia/CI/index.php/orders';
       $config['total_rows'] = $this->Admin_model->emp_counter_records();
       $config['per_page'] = 15;

       $config['uri_segment'] = 3;
       $widok['submenu'] = $this->load->view('Admin/submenu_orders_view','adasd',true);

      $this->pagination->initialize($config);
      $id = $this->uri->segment(3,0);

      $query = $this->Admin_model->get_orders();
      $widok['main'] = '<table class="admin_books">
                        <th>ID</th>
                        <th>Sposób dostawy</th>
                        <th>Status</th><th>Zmień</th>
                        <th>Suma całkowita</th>
                        <th>Ilość</th><th>Przypisz pracownika</th>
                        <th>Zatwierdź</th>';

      if($query->num_rows() > 0)
      {
          foreach($query->result() as $item)
          {
              $widok['main'] .= $this->load->view('Admin/get_orders',array('data'=>$item,'emp_name' => $this->Admin_model->get_emp_name()),true);
          }

      }
      $widok['main'] .= '</table>';
      $widok['main'] .= '</br><div class="pagination">'.$this->pagination->create_links().'</div>';

      $this->load->view('Admin/admin_index',$widok);



    }

and this is view:
Code:
&lt;?php
form_open_multipart('orders/change_status/'.$data->ORDER_ID);
echo
'<tr>
<td>'.$data->ORDER_ID.'</td>
<td>'.$data->ORDER_DeliveryType.'</td>
<td>'.$data->ORDER_Status.'</td>
<td><select name="status_'.$data->ORDER_ID.'"><option selected>'.$data->ORDER_Status.'</option>
    <option>oczekuje</option>
    <option>w trakcie</option>
    <option>zrealizowany</option>
    <option>anulowany</option>
</select></td>
<td>'.$data->ORDERPr_Price.'</td>
<td>'.$data->ORDERPr_Quantity.'</td>

<td>
<select name="emp_'.$data->ORDER_ID.'">
<option selected>przypisz pracownika</option>';
foreach($emp_name->result() as $item):
echo "<option>".$item->EMP_Name." ".$item->EMP_LastName."</option>";
endforeach;
echo '</select></td>
    <td>&lt;input type="submit" style="width:60px; height:20px; background:none; color:green; font-size:12px; margin-top:0px;"/&gt;&lt;/td></tr>';


form_close();
?&gt;

please, help me.
#2

[eluser]johnpeace[/eluser]
You need to give your submit input a name attribute and value.
#3

[eluser]cahva[/eluser]
[quote author="johnpeace" date="1297667228"]You need to give your submit input a name attribute and value.[/quote]
Nopes thats not it and its not mandatory to have name or value in submit button. Input button does'nt work because there is no form so its not sending it.
You need to print the form_open() and form_close()
Code:
echo form_open_multipart('orders/change_status/'.$data->ORDER_ID);
...
echo form_close();




Theme © iAndrew 2016 - Forum software by © MyBB