cherifgx Posted June 1, 2013 Share Posted June 1, 2013 hi, am creating a module, and want to use the helperForm and the helperList to manage ans list contents of a slider that i want to integrate within prestashop. so in the ModuleAdminController , after the parent :: __construct(); i have $this->fieldImageSettings = array( 'name' => 'image', 'dir' => 'v' ); $this->fields_list = array ( 'image' => array( 'title' => $this->l('Icon'), 'align' => 'center', 'image' => $this->fieldImageSettings["dir"], 'width' => 70, )), and at the render form : public function renderForm() { // Building the Add/Edit form $this->fields_form = array( 'legend' => array( 'title' => $this->l('Edit') ), 'input' => array( array( 'type' =>'file', 'label'=>$this->l('Link Icon'), 'name'=>'image', 'required' => false, 'display_image' => true ), 'submit' => array( 'title' => $this->l(' Save '), 'class' => 'button' ) ) ); return parent::renderForm(); } but when i upload image , i got The image field is required. Link to comment Share on other sites More sharing options...
jave.web Posted June 5, 2016 Share Posted June 5, 2016 (edited) I don't think 'submit' belongs inside 'input', I think it belongs outside ... like: public function renderForm() { // Building the Add/Edit form $this->fields_form = array( 'legend' => array( 'title' => $this->l('Edit') ), 'input' => array( array( 'type' =>'file', 'label'=>$this->l('Link Icon'), 'name'=>'image', 'required' => false, 'display_image' => true ) ), 'submit' => array( 'title' => $this->l(' Save '), 'class' => 'button' ) ); return parent::renderForm(); } ...but maybe that was just old PS... try that and you'll see Edited June 5, 2016 by jave.web (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts