Welcome Guest, Not a member yet? Register   Sign In
validation on a checkbox
#5

[eluser]maesk[/eluser]
@steelaz, thank you, I found this very useful indeed! After spending some hours trying to make validation of a checkbox work and setting a custom error message for the checkbox I found this post and it finally works now! Here's my code (snippet)

Code:
// Set Rules for required fields
    $rules['sender_name'] = "required";
    $rules['from'] = "required|valid_email";
    $rules['to'] = "required|valid_email";
    $rules['terms'] = "required|isset";
    $this->validation->set_rules($rules);

...

// Set multilingual custom error messages
    $this->validation->set_message('required', $this->lang->line('Required'));
    $this->validation->set_message('valid_email', $this->lang->line('ValidEmail'));
    $this->validation->set_message('isset', $this->lang->line('PleaseAcceptTerms'));


Messages In This Thread
validation on a checkbox - by El Forum - 03-11-2008, 10:33 AM
validation on a checkbox - by El Forum - 03-23-2008, 01:00 PM
validation on a checkbox - by El Forum - 04-17-2008, 01:46 PM
validation on a checkbox - by El Forum - 04-17-2008, 03:25 PM
validation on a checkbox - by El Forum - 05-29-2008, 03:59 AM



Theme © iAndrew 2016 - Forum software by © MyBB