Welcome Guest, Not a member yet? Register   Sign In
Generic message for form validation
#1

[eluser]Stompfrog[/eluser]
Hi all,

I am half way through my first CI project and I am loving it. Just got to the validation class and think it is brilliant. The documentation for CI is very useful.

I do have one question tho.

As well as the specific error messages appearing next to each invalid input field I would like to put a generic error message at the top of my form.

Something along the lines of... "There appears to be a problem with your submission please see errors below".

I tried adding the following code to my view file...
Code:
if($this->validation->run() == FALSE)
{
//message here
}

...but this function always seems to return false even the first time the form is loaded, before a submission attempt is made. This means the generic error message always displays which is not good.

Is there any other existing logic I can use to achieve this or do i need to do something more complicated?

Thanks


Messages In This Thread
Generic message for form validation - by El Forum - 07-12-2008, 06:41 AM
Generic message for form validation - by El Forum - 07-12-2008, 06:49 AM
Generic message for form validation - by El Forum - 07-12-2008, 06:49 AM
Generic message for form validation - by El Forum - 07-12-2008, 07:01 AM
Generic message for form validation - by El Forum - 07-15-2008, 06:19 PM



Theme © iAndrew 2016 - Forum software by © MyBB