• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Form Validation Errors (Grouping)

#1
[eluser]RS71[/eluser]
Hello

How could I group certain form validation errors together so the errors returned are not repetitive?

What I mean is -- lets say the user submits a blank form, instead of displaying "The ABC field is required." over and over for every field in the form, how can I just say "Every field in the form is required." in the case of the 'required' rule for example.

I'd appreciate if anybody could point me in the right direction.

Thanks in advance.

#2
[eluser]frist44[/eluser]
create a callback function that checks each field in the form and set the message to whatever you want it to say. Associate it with any field in the form and it will run and do whatever you code it to do.

IE.

function form_check() {

if (!$this->input->post('textfield1')) return FALSE;
if (!$this->input->post('textfield2')) return FALSE;

return TRUE;
}


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.