CodeIgniter Forums
Setting up Hidden field value with set_value - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Setting up Hidden field value with set_value (/showthread.php?tid=27745)



Setting up Hidden field value with set_value - El Forum - 02-19-2010

[eluser]upstream[/eluser]
Hey guys

I have a hidden field where i store the record_id for updating. but once the user submit and the goes to validation process it seems that the hidden field's value is gone @__@ been checking this for hours now so i think i need a little help here.


The rules
Code:
public function _set_rules()
    {
        $rules = array(array('field'=>'customer_id','Customer','rules'=>'required|xss_clean'),
                       array('field'=>'customer_name','label'=>'Customer','rules'=>'trim|required|min_length[3]|max_length[100]|callback__name_check|xss_clean'),
                       array('field'=>'description','label'=>'Description','rules'=>'xss_clean'));  
        $this->form_validation->set_rules($rules);
        $this->form_validation->set_error_delimiters('<div>','</div>');
    }

The hidden field
Code:
&lt;input type="hidden" name="customer_id" value="&lt;?php echo set_value('customer_id'); ?&gt;" /&gt;

please help @__@


Setting up Hidden field value with set_value - El Forum - 02-19-2010

[eluser]rogierb[/eluser]
What does print_r($_POST) say about the customer_id?
Is the hidden field filled?


Setting up Hidden field value with set_value - El Forum - 04-19-2011

[eluser]OyoKooN[/eluser]
Hello,

I reply to this thread because I have the same problem.
When I print $_POST, I can see all my inputs.

In advance, thank you.