Code Igniter and Jquery Validation Plugin - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Code Igniter and Jquery Validation Plugin (/showthread.php?tid=10298) Pages:
1
2
|
Code Igniter and Jquery Validation Plugin - El Forum - 07-25-2008 [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.. Code Igniter and Jquery Validation Plugin - El Forum - 07-25-2008 [eluser]jnorris441[/eluser] One says checkuser and the other one says checkemail. Is that the problem? Code Igniter and Jquery Validation Plugin - El Forum - 07-25-2008 [eluser]Xtrex[/eluser] nop, my mistake.. the problem is not simple errors, I tryed everything, I cant do it.. Code Igniter and Jquery Validation Plugin - El Forum - 07-25-2008 [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. Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [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. Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [eluser]Xtrex[/eluser] it doest work I dont know what to do, I tryied everything!! 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.. Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [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) Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [eluser]Xtrex[/eluser] dont work I use a ajax request in the form submit and it works, maybe its something with the jquery validate plugin in conflit with CI.. Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [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. Code Igniter and Jquery Validation Plugin - El Forum - 07-26-2008 [eluser]Xtrex[/eluser] thank you |