Welcome Guest, Not a member yet? Register   Sign In
Validate Checkbox
#1

[eluser]Fireclave[/eluser]
I will validate a checkbox (checked or not)

In my View is:
<p>&lt;?php echo form_checkbox( $data_terms_of_use ) ?&gt; I aggree the &lt;?php echo anchor('terms_of_use/', 'Terms of use') ?&gt; zu.</p>

In my Controler is:
$this->form_validation->set_rules('terms_of_use', '', 'callback_terms');
...

// To check wheter the Checkbox is checked
function terms($str)
{
if(!$str) return false;
$this->form_validation->set_message('terms_of_use', 'You must accept the terms to register.' );
return true;
}

sorry for my english, but my problem is, that this is not working. i use the input_validation class to validate the checkbox. in $data_terms_of_use are the datas for the checkbox


Messages In This Thread
Validate Checkbox - by El Forum - 04-07-2010, 06:08 AM
Validate Checkbox - by El Forum - 04-07-2010, 01:41 PM
Validate Checkbox - by El Forum - 04-07-2010, 04:55 PM
Validate Checkbox - by El Forum - 04-08-2010, 01:08 AM
Validate Checkbox - by El Forum - 04-08-2010, 01:09 AM



Theme © iAndrew 2016 - Forum software by © MyBB