Welcome Guest, Not a member yet? Register   Sign In
Problem with Validation when using an image submit button
#5

[eluser]Aken[/eluser]
1) Your problem is that when you hit the enter key, the name value of the image does not transfer in with the rest of the form variables.

2) You should not check for a post variable to see if the form is submitted. The form_validation->run() function does that for you. Read the form_validation page carefully, it explains how to check for that very thing.

3) You don't need to load the form_validation library again in your view. Once in the controller is sufficient.

4) You can use custom functions called callbacks as a rule when validating a form. You should consider using that for checking if the username exists instead of using flashdata and redirects.

5) When doing redirects, you don't use the return property with them. You should also use the exit; property right after a redirect.

Your code seems to work, but it can be cleaned up a lot. Those are good places to start.


Messages In This Thread
Problem with Validation when using an image submit button - by El Forum - 09-07-2009, 05:53 AM



Theme © iAndrew 2016 - Forum software by © MyBB