CodeIgniter Forums
SOLVED: CI + jQuery forms - 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: SOLVED: CI + jQuery forms (/showthread.php?tid=2888)



SOLVED: CI + jQuery forms - El Forum - 08-29-2007

[eluser]stevefink[/eluser]
Does anyone have any experience with using jQuery forms within CI?

I have a really simple target: callback which works fine outside of CI:

Code:
$(document).ready(function() {
    // bind 'form2' and provide a simple callback function
    $('#form2').ajaxForm(function() {
        // Server should send data back in json encoding
        target: '#container'
    });  
});


all that should do is pop in the response of my script into <div id="container></div>. I'm not getting any errors, just not seeing updated content. My action method looks like this:

Code:
function photo_mod()
    {
        /**
         * Process photo modifications here. The form from photos_view.php
         * gets process in this method.
         */    
        echo  "<pre>DEBUG TEXT</pre>";
    }

Thanks all.


SOLVED: CI + jQuery forms - El Forum - 08-29-2007

[eluser]stevefink[/eluser]
I figured this out in case anyone runs into the same issue. .ajaxForm() is expecting a parameter listed .. not a callback function with a parameter list.

The following syntax is the proper way to get this working:

Code:
$(document).ready(function() {
    // bind 'form2' and provide a simple callback function
    $('#form2').ajaxForm(
        {
            target: '#container',
            type: 'post'
        }
        
    );
});



SOLVED: CI + jQuery forms - El Forum - 08-29-2007

[eluser]CodeOfficer[/eluser]
Good to know I'll be using this soon, thanks for posting.


SOLVED: CI + jQuery forms - El Forum - 08-31-2007

[eluser]worchyld[/eluser]
Are there any working live *simple* examples of jQuery and CI working together. Something stupidily simple, like an autocomplete, or jQuery FX.