Code Igniter and Jquery Validation Plugin |
[eluser]Xtrex[/eluser]
I, I cant resolve this problem.. I am using CI with Jquery validation plugin. I have this code with jquery: To validate the form I need to check in a DB id the username does't exist, so I am trying to use: (the remote use AJAX) Code: email: { But it dont work.. but if I use a CI external file, connecting to the DB it work, like: Code: email: { In CI I use this controller: Code: // Controller The model and the controller works fine! Help me please, dont know what to do..
[eluser]jnorris441[/eluser]
One says checkuser and the other one says checkemail. Is that the problem?
[eluser]Xtrex[/eluser]
nop, my mistake.. the problem is not simple errors, I tryed everything, I cant do it.. ![]()
[eluser]jnorris441[/eluser]
You aren't doing anything with the return value from the model? EDIT: Sorry I see where you are echoing from the model.
[eluser]marcoss[/eluser]
Don't echo from the Model, use return instead. Code: // Model The in your controller output a VALUE to be checked by JS, like this: Code: // Controller As a side note, you should output the value through a view, not directly from the controller.
[eluser]Xtrex[/eluser]
it doest work ![]() this a example of emails.php that works: Code: <?php but even if I pass it to the controller checkemail, to test, it dont work..
[eluser]Pascal Kriete[/eluser]
[quote author="Xtrex" date="1217027058"] Code: function atribuido($tabela,$atributo,$campo) The ajax request gets the string output, not the value. Echoing false doesn't return anything, and echoing true just returns 1. Try echoing the string instead. Since this request doesn't need anything else, you can make debugging easier by killing the script to avoid any unexpected output. Code: if ($query->num_rows() > 0)
[eluser]Xtrex[/eluser]
dont work ![]()
[eluser]Pascal Kriete[/eluser]
Oh silly me, I remember this problem from another thread. The validation script uses GET to send the values - CI kills the $_GET array. I'm pretty close to implementing this myself, so when I do I'll post back with the required changes.
|
Welcome Guest, Not a member yet? Register Sign In |