Welcome Guest, Not a member yet? Register   Sign In
Help with passing form values via ajax (jquery) to codeigniter form validate.
#1

[eluser]dottedquad[/eluser]
The way my form is setup is, I'm not posting the values to the server. Instead, I'm using jquery tools for client side validation and used e.preventDefault(); to prevent any form submit logic. When the client-side validation passes I do:

Code:
var $field_values = "species/" + $fld_species + "/alias/" + $fld_alias + "/parents/" + $fld_parents + "/gender/" + $fld_gender + "/breed/" + $fld_breed + "/birth_date/" + $fld_birth_date + "/location/" + $fld_location + "/comment/" + $fld_comment;
            
                    // submit the data to the server with AJAX
                    $.getJSON("validate_livestock_form/index/" + $field_values, function(json) {

That code works as expected. Now, my question is, with the codeigniter form validation library I think it requires an actual form submit for it to work. Am I correct? If I am, is there a way to fake a post like send a header or something along those lines to get the codeigniter form validation to work with my $.getJSON? It's hard to explain what I'm asking so please let me know if I need to elaborate more.

-Rich


Messages In This Thread
Help with passing form values via ajax (jquery) to codeigniter form validate. - by El Forum - 06-09-2010, 05:44 PM



Theme © iAndrew 2016 - Forum software by © MyBB