Welcome Guest, Not a member yet? Register   Sign In
form validation and checking for allowed values for example in listbox
#2

[eluser]CroNiX[/eluser]
You can only pass strings via the 2nd parameter, so you need to do something like:
Code:
$this->form_validation->set_rules('admin_title', 'Somefield', 'required|valid_array_element[' . implode(';', $array) . ']');

And then in your validation function, first line:
Code:
function valid_array_element($str, $allowed)
{
  $allowed = explode(';', $allowed);
  //..rest of your code
}


Messages In This Thread
form validation and checking for allowed values for example in listbox - by El Forum - 12-01-2012, 11:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB