Welcome Guest, Not a member yet? Register   Sign In
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;
}




Theme © iAndrew 2016 - Forum software by © MyBB