Welcome Guest, Not a member yet? Register   Sign In
[solved]Can I pass two parameter for form validation callback_function ?
#1

[eluser]Unknown[/eluser]
I would like to know is it possible to pass two parameter to a callback function?
If yes, how do i implement?

$first and $second and $max are field names from form
Code:
function calculate
{
extract($_POST);
$answer = $first + $second;

$this->form_validation->set_rules('answer','Answer','callback_check_maximum|xss_clean');

if ($this->form_validation->run() == FALSE)
{
  //hasn't been run or they are validation errors
  $this->check_again();
}
}
else
{
  //proceed
}

function check_maximum($answer,$max)
{
if ($answer > max)
{
return false
}
}


Many thanks




Theme © iAndrew 2016 - Forum software by © MyBB