CI and js Form Validation |
[eluser]Nick Husher[/eluser]
CodeIgniter only does server-side validation. It sets up logical framework for determining if the user input is correct and lets you determine how you want that validation to happen. You can use the CI form validation over an Ajax link, although there's no boxed way to do it as far as I know. The basic workflow would be to hijack the "submit" event on the form, capture the form data, and send it to a CI method that could validate the data and return an appropriate response. Code: <form id="myform" action="some action" method="post"> Code: // using YUI, but you don't have to Code: var callback = { Code: // in "ajax_controller.php" Also, I wrote up a tutorial on using Ajax and CI together in this thread. It makes use of server-side form validation over an ajax link, as described above. |
Messages In This Thread |
CI and js Form Validation - by El Forum - 11-11-2008, 10:53 AM
CI and js Form Validation - by El Forum - 11-11-2008, 12:35 PM
|