[HELP] - Error handeling for a form - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: [HELP] - Error handeling for a form (/showthread.php?tid=27450) |
[HELP] - Error handeling for a form - El Forum - 02-11-2010 [eluser]Bainzy[/eluser] Hi everybody, Today i started to make a registration form for my site, everything is going fine so far but now i have run into a little problem and i dont know how to cure it. Basically i have the following fields Username Nickname Password Confirm Password Confirm Email Now at the minute i am using codeigniteres built in form helper so to show the simple errors like boxes not being filled in and returning the user to the form showing these errors. Thats all great. The part i am stuck on it once all the boxes are filled in and its passed to my controller for processing, i want to compair the two password entries to make sure they match and then the same with the two email fields, if either of these do not match i would like to return the user to the form and show the error for the user to correct, now i dont know if there is something in codeigniter which i can use to do this. I thought i had it working with the following code : Code: // The user has entered all the data, now check the data Now here is my register form to show these errors : Code: <?php This shows a box at the top of the page with all the errors for that page so its not cluttering my form, this worked perfect untill i modified my code like this : Code: // The user has entered all the data, now check the data Now whats happening its still working fine, however the page is loaded twice, one under each other with the seperate errors shown, this is obviously not what i want. Now i know my code aint perfect, far from it, however how is the best way to go about handeling this ? Regards Chris [HELP] - Error handeling for a form - El Forum - 02-11-2010 [eluser]Bainzy[/eluser] Does not matter close this topic, just saw the matches function. |