Jump to content

why id_employee value not retrieve with me


Recommended Posts

 

Quote
 public function initFormByDrivers() {

        $this->fields_form = array(
            'legend' => array(
                'title' => $this->l('By Drivers'),
                'icon' => 'icon-calendar'
            ),
            'input' => array(
                array(
                    'type' => 'select',
                    'lang' => true,
                    'name' => 'id_employee',
                    'col' => '8',
                    'label' => $this->l('Drivers'),
                    'required' => true,
                    'options' => array(
                        'query' => Employee::getDriverEmployees(true),
                        'id' => 'id_employee',
                        'name'=> 'full_name',
                    )
                ),
            ),
        );

        $this->table = 'driver';
        $this->show_toolbar = true;
        $this->show_form_cancel_button = true;
        return parent::renderForm();

    }

option  => id => id_employee


 echo Tools::getValue('id_employee');die();

when print id_employee in postProcess  not retrieve value why?image.thumb.png.ee3c97089a93138335f5c2d5b04bd85a.png

 

Link to comment
Share on other sites

Hmm well  not sure without taking a look at other code but maybe this is happening.

You have that top custom form without Generate pdf button, and it is separate form.

But you click on bottom Generate button that is just "By order status" and that form do not have "By Drivers" field information.

So you can not retrieve id_employee just like that.

 

You could try to add submit button there, and like  other two forms later in code do a check if that button is pressed and execute command which will involve id_employee.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...