Welcome Guest, Not a member yet? Register   Sign In
validation not working
#5

[eluser]diasansley[/eluser]
here is the code now it says page cannot be found plz help

<?php
class Form extends Controller{
function _construct(){
parent::Controller();
}
}
function index()
{
$this->load->helper(array('form', 'url'));

$this->load->library('validation');

$rules['username'] = "callback_username_check";
$rules['password'] = "required";
$rules['passconf'] = "required";
$rules['email'] = "required";

$this->validation->set_rules($rules);

if ($this->validation->run() == FALSE)
{
$this->load->view('myform');
}
else
{
$this->load->view('formsuccess');
}
}

function username_check($str)
{
if ($str == 'test')
{
$this->validation->set_message('username_check', 'The %s field can not be the word "test"');
return FALSE;
}
else
{
return TRUE;
}
}
?>


Messages In This Thread
validation not working - by El Forum - 11-21-2010, 10:06 PM
validation not working - by El Forum - 11-21-2010, 10:39 PM
validation not working - by El Forum - 11-21-2010, 10:45 PM
validation not working - by El Forum - 11-21-2010, 11:15 PM
validation not working - by El Forum - 11-21-2010, 11:41 PM
validation not working - by El Forum - 11-21-2010, 11:49 PM
validation not working - by El Forum - 11-22-2010, 08:30 AM
validation not working - by El Forum - 11-23-2010, 01:32 AM
validation not working - by El Forum - 11-23-2010, 07:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB