ajax validation in CI with 'jQuery validation plugin' |
[eluser]santorini[/eluser]
The client-side validation is working properly. The validation using ajax request (remote) does not work. the path for the request is correct.. the validation methods themselves should be correct. firebug error: "NetworkError: 500 Internal Server Error - http://localhost:8888/work/ci_buchverwal...zer_exists" ..but the path to the method 'register_benutzer_exists' is correct.. I don't understand what is wrong..any help? //view Code: echo '<!-- Start Formular -->'; //js Code: [removed] Code: //--------------------------------- Code: //---------------------------------
[eluser]PhilTem[/eluser]
You receive a different error message than a "page not found". What you get is an internal server error Quote:NetworkError: 500 Internal Server Error In most cases this happens when you have some line of code that makes your sever go like "ermahgerd". I think the problem causing line(s) are somewhere else because your posted lines look pretty good and faultless. Though there might be an error emerging from Code: if (array_key_exists('benutzername', $_POST)) { Try changing it to Code: if ( $this->input->post('benutzername') ) { and see if it works.
[eluser]santorini[/eluser]
I've made the change.. remote validation still does not work. post data in firebug is existing... view in firebug: Code: POST: thanks
[eluser]CroNiX[/eluser]
Sounds like you have CSRF protection enabled, but aren't sending the CSRF cookie value along with your form values in the ajax call. As far as I know, the error message "The action you have requested is not allowed." is only caused by CSRF.
[eluser]santorini[/eluser]
CSRF protection was enabled, but if the CSRF protection is off the ajax request should be executed...I understand this correctly? Unfortunately, the validation still does not work. I don't understand that...
[eluser]LuckyFella73[/eluser]
I'm confused about your urls ... Your base_url / site_url seems to be " http://localhost:8888/work/ci_buchverwaltung/" If you call 'redaktion/nutzer/register_benutzer_exists' then you call a controller named "redaktion" and the included method "nutzer" In that case "register_benutzer_exists" would be a parameter (send to "nutzer" method) and not a method. Or do you route somehow?
[eluser]santorini[/eluser]
actually i will call a controller named 'nutzer' and the included method 'register_benutzer_exists'. the controller 'nutzer' is inside a folder 'named 'redaktion'. my routing: Code: $route['default_controller'] = "redaktion/login"; this should be okay?
[eluser]LuckyFella73[/eluser]
I'm no routing expert so I can't comment that If I were you I would start debugging on an easier level. First fire a simple ajax request to your validation method and return a json debug message (log in console). If you get your response go on and add features. Can be hard to find a bug if you have to many functionality at once sometime .. Best wishes - Luckyfella |
Welcome Guest, Not a member yet? Register Sign In |