2017-02-17 102 views
0
$fields_form = array(
     'form' => array(
      'legend' => array(
       'title' => $this->l('Configure Settings'), 
       'icon' => 'icon-cogs' 
      ), 
      'description' => $form_desc, 
     'input' => array(
      array(
       'type'  => 'text', 
       'label' => $this->l('textfield1'), 
       'name'  => 'username', 
       'size'  => 50, 
       'class' => 'fixed-width-xxl', 
       'required' => true 
     ), 
      array(
       'type'  => 'password', 
       'label' => $this->l('textfield2'), 
       'name'  => 'password', 
       'size'  => 50, 
       'class' => 'fixed-width-xl', 
       'required' => true, 
     ), 
      ), 
      'submit' => array(
       'name' => 'submitconfigureoptions', 
       'title' => $this->l('Save'), 
       'icon' => 'process-icon-save', 
       'class' => 'btn btn-default pull-right' 

     ), 
     ) 
    ); 

我有四個輸入文本字段的表單和一個提交button.So,提交表單我在輸入文本字段中輸入相同的值後,必須以頁面刷新後的形式顯示。顯示相同的表單數據

+0

在這種情況下,您可以將字段保存到本地存儲並顯示。如果你能提供你的代碼,這將是有幫助的。 –

回答

0

要在助手錶堅持的值,可以使用下面的代碼:

$helper->fields_value['field_name'] = 'field_value'; 

的generateForm()函數之前添加此代碼,這將頁面加載前值添加到您的領域。