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

[eluser]seba22[/eluser]
Hello Friends,

No success, still Internal Server Error.

I corrected spell typo like PhilTem found, and make changes like You suggested.

Code:
<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Form_validation extends CI_Form_validation {

    function __construct()
    {
        parent::__construct();  

    }
    
    

  function valid_array_element($str, $allowed)
{

  $allowed = explode(';', $allowed);
if (in_array($str, $allowed)) {
return TRUE;
}
else
{
    //failed rule, set error message and return FALSE
$this->set_error('valid_array_element', 'The %s field can only be one of the following options: ' . implode(', ', $allowed));

return FALSE;
}
          
        }
        
  
}
?>

Hmmm


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



Theme © iAndrew 2016 - Forum software by © MyBB