Validation Rules |
[eluser]xtremer360[/eluser]
I'm trying to figure out why my registration controller is not validating my submit form data. http://www.kansasoutlawwrestling.com/kow...r/register Registration Controller Code http://pastebin.com/MEinkAtL form_validation rules array which was placed into the application/config folder Code: <?php
[eluser]Aken[/eluser]
My guess is your ajax URL to POST to is wrong. Have you used Firebug or other Javascript console to see if there are any errors returned? They'll tell you if there's a 404 error or something with the ajax request.
[eluser]Aken[/eluser]
I'd confirm that your POST request is going to the proper URL first, then debug from there.
[eluser]xtremer360[/eluser]
For some reason its still not validating. http://pastebin.com/YqUMuehU http://www.kansasoutlawwrestling.com/kow...r/register
[eluser]xtremer360[/eluser]
Found the issue it was with the rule of the callback in the form validation. I needed email_address not just email.
[eluser]CroNiX[/eluser]
It seems to POST to /register/submit fine. In firebug, I receive the following response back from the server via ajax: Quote:<br /> If you are using firebug and examining the responses, how do you not see these errors? Also, you are still returning the string 'The form was not validated!' no matter what the errors are. It would be MUCH better to at least return the output of validation_errors() so that the user doesn't have to guess where on the form the problem is, even if they don't show up right next to each form field.
[eluser]xtremer360[/eluser]
Well CroNiX I added the validation errors like so: $output_array = array( 'error' => TRUE, 'message' => validation_errors() ); And this came up: Unable to access an error message corresponding to your field name. Unable to access an error message corresponding to your field name.
[eluser]CroNiX[/eluser]
That would go back to our discussion from yesterday where the error name must match the name of the callback function exactly. Code: public function _some_callback($var) function name is "_some_callback" error message set for "_some_callback" If these 2 names don't match exactly, you'll get the error you are because it won't be able to find the error message that goes to that validation rule...
[eluser]xtremer360[/eluser]
So I updated with this: Code: ublic function _email_address_exists($str) And still the same. |
Welcome Guest, Not a member yet? Register Sign In |