Serial Posted June 8, 2017 Share Posted June 8, 2017 Hi, I have a form with a select field. I want to set this field empty. This is the definition of the field in the form : array( 'type' => 'select', 'name' => 'PROMOTDU_SUPPR', 'required' => true, 'label' => $this->l('Liste des promotions actives : '), 'options' => array( 'query' => $options, 'id' => 'id', 'name' => 'name' ) ), I want $options empty so, I wrote this before : $options[] = array(); But I have 2 errors : undefined index : id undefined index : name Thanks for your help Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted June 8, 2017 Share Posted June 8, 2017 Hi..use like this $options = array(array('id' => '', 'name' => '')); array( 'type' => 'select', 'name' => 'PROMOTDU_SUPPR', 'required' => true, 'label' => $this->l('Liste des promotions actives : '), 'options' => array( 'query' => $options, 'id' => 'id', 'name' => 'name' ) ), Thanks Link to comment Share on other sites More sharing options...
Serial Posted June 8, 2017 Author Share Posted June 8, 2017 It was very simple. Thanks Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now