• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Jquery Validation URL Problem

#1
[eluser]hykoh[/eluser]
Hello,

i got a problem with my jQuery Validation URL ... it always try to send:

Code:
GET http://www.example.com/registration/ajaxControl/?username=test 190ms

It responds (cauz the GET Query Request):

Code:
The URI you submitted has disallowed characters.

I've looked in the jquery.validate.js to locate the URL building function, but without results.

Is there any way for CI to rewrite the URLs to segments like

Code:
registration/ajaxControl/username/test

Thanks for your help

#2
[eluser]Nick Husher[/eluser]
Not knowing that much about jQuery, would it be possible to pass it by POST instead of GET?

#3
[eluser]Pascal Kriete[/eluser]
Nick is on the ball, as usual.
In the 'remote' function there is a call to $.ajax . I don't have the source in front of me, but what you need to do is add the type parameter:
Code:
$.ajax({
    url: something,
    type: 'POST', //add this
  // ....
});

#4
[eluser]Nick Husher[/eluser]
Just to be really clear, GET query strings in CodeIgniter are disallowed by default. Characters in your disallowed url characters list (in config or routes.php, IIRC) will trigger the error message you're getting. As an alternative to using POST, you can take a look at enabling query strings and enabling some creative routing:

http://ellislab.com/codeigniter/user-gui.../urls.html


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.