CodeIgniter & jQuery validation |
[eluser]Mr Scientist[/eluser]
Hi all, I have been writing a contact page for a website I'm building. This page has both front-end (JQuery) and backend (CodeIgniter) valiation in it. When the contact form is submitted the JQuery validation does seem to bring up errors but the page skips straight to the form action address regardless of there being validation erroes on the front-end. Below is the code used in my view - Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> I was hoping that one of you guys here on the forum may able to help to get both the font and backend validation working propery.
[eluser]TheFuzzy0ne[/eluser]
It sounds to me like your JavaScript validate() function is not returning false or something along those lines. Please post your validate() function.
[eluser]Mr Scientist[/eluser]
The validate function is one that is part of the jQuery Validation Plugin. The documentation is available here - jQuery Validation Documentation
[eluser]Mr Scientist[/eluser]
I've now written the following script which I've been having the same problems as mentioned earlier Code: $(document).ready(function() { The only thing that has changed in the view is that the classes on each form element has been removed and also the following code Code: $(document).ready(function(){ |
Welcome Guest, Not a member yet? Register Sign In |