Click here to Skip to main content
12,449,919 members (52,755 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: PHP Ajax jQuery
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
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 1-Oct-12 2:06am
Updated 1-Oct-12 2:25am
v2

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

It is nice to have some code. Do you have a question as well Smile | :) ?
  Permalink  
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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160826.1 | Last Updated 1 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100