Welcome Guest, Not a member yet? Register   Sign In
Using form validation to validate the $post array
#1

Hi all

quick question

i have a form which has alot of fields which are labeled as item1 item1a item2 item2b item3 item3b ect all the way up to 52

they will all need to be validated with the same options can i use the $post array in the validation

$data = $this->input->post(NULL, TRUE);

$this->form_validation->set_rules($data, 'data', 'required');

if ($this->form_validation->run() == FALSE)
{
echo "fail";
}
else
{
echo "win";
}

so i can validate them all in one swoop rather than doing a separate line for each ?

many thanks

cbiz
Reply


Messages In This Thread
Using form validation to validate the $post array - by cbiz316 - 12-10-2014, 04:03 AM



Theme © iAndrew 2016 - Forum software by © MyBB