Welcome Guest, Not a member yet? Register   Sign In
Form input fields +form_validation required but not equal to default???
#5

[eluser]jbreitweiser[/eluser]
Write a callback that tests for your default value and fails if that value is found.

Code:
function notDefaultText($str){
  if($str == '...here your first name'){
     return FALSE;
  } else {
     return TRUE;
  }
}
Now set your form validation to
Code:
$this->form_validation->set_rules('fname', 'fname', 'trim|required|callback_notDefaultText');


Messages In This Thread
Form input fields +form_validation required but not equal to default??? - by El Forum - 01-11-2010, 01:47 PM



Theme © iAndrew 2016 - Forum software by © MyBB