Click here to Skip to main content
14,827,034 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I hope I did not come to the wrong site but I need some light in terms of posting data using ajax and jquery I don't know where I'm going wrong hence I'm new to jquery and ajax any assistance will be appreciated

I have this code
JavaScript
var query = "companyname=" + companyname + "&Address1=" +address1 ;
                    query+= "&Address2=" + address2 + "&Area=" + area+ "&city="+city +"&code="+code;
                    query+= "&Province="+Province +"&fullname="+fullname+"&surname="+surname+"&email="+email +"&pass="+pass+"&number="+contacts+"&choice="+usertype;

                  alert(query);
                    $.ajax({
                        type :"POST",
                        url :"inc/functions.php?action=newagent",
                        data : query,
                        success: function(data){
                            if (data =='Success'){
                                //setTimeout('proceed()',5000);
                                alert("Success using Jquery");
                            }
                        }});
Posted
Updated 1-Oct-12 2:25am
v2

1 solution

It is nice to have some code. Do you have a question as well :) ?
   
Comments
Member 7763261 1-Oct-12 8:41am
   
Yes kenneth my question is what am I doing wrong here because the ajax fuction is not posting the query to the relevant php file so that data can be processed i.e This function is not working and I cant peak up why I've tried to trace but I cant find the bug please me where I'm going wrong $.ajax({
type :"POST",
url :"inc/functions.php?action=newagent",
data : query,
success: function(data){
if (data =='Success'){
//setTimeout('proceed()',5000);
alert("Success using Jquery");
}
}});

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900