scotch-io/ajax-forms-jquery

json encode

Closed this issue · 1 comments

Thank you for the example. I had an issue passing $_POST values to the php script.
I found out I needed to add encode to true.

                $.ajax({
                        type            : 'POST', // define the type of HTTP verb we want to use (POST for our form)
                        url             : 'script.php', // the url where we want to POST
                        data            : formData, // our data object
                        dataType        : 'json', // what type of data do we expect back from the server
                        encode:         true
                })

Updated the code and tutorial to have this. Thanks.