![]() |
Post a form with Jquery+Ajax - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Post a form with Jquery+Ajax (/showthread.php?tid=43175) |
Post a form with Jquery+Ajax - El Forum - 07-03-2011 [eluser]vickatg[/eluser] Am posting a form with jquery+ajax but i dont get any changes, below is what i have done so far Code: $(function() { and below is my form Code: <form method="post" name="form"> where could i be messing up? probably i have doubt on how to specify the url help me out. Post a form with Jquery+Ajax - El Forum - 07-03-2011 [eluser]alexaaaaaaaaaa[/eluser] [quote author="vickatg" date="1309702351"]Am posting a form with jquery+ajax but i dont get any changes, below is what i have done so far Code: $(function() { use firebug...best way to see where's the problem. Post a form with Jquery+Ajax - El Forum - 07-03-2011 [eluser]Ephyzy[/eluser] Code: dataString = 'name='+ name + '&username;=' + username + '&password;=' + password + '&gender;=' + gender; should be (removing the semi-colons, what are they there for?): Code: dataString = 'name='+ name + '&username;=' + username + '&password;=' + password + '&gender;=' + gender; Then I think it should work. Edit: ok I realize that the semi-colons are automatically added. They are probably not there in your original source code! Post a form with Jquery+Ajax - El Forum - 07-03-2011 [eluser]stuckinphp[/eluser] Your code supplied is working correctly. Could you post your controller function? Post a form with Jquery+Ajax - El Forum - 07-04-2011 [eluser]vickatg[/eluser] Thanks alot for your contribution, the problem was in my controller. i located it with firebug. Post a form with Jquery+Ajax - El Forum - 07-04-2011 [eluser]alexaaaaaaaaaa[/eluser] [quote author="vickatg" date="1309778050"]Thanks alot for your contribution, the problem was in my controller. i located it with firebug.[/quote] firebug rocks when you have problems with javascript. Post a form with Jquery+Ajax - El Forum - 07-05-2011 [eluser]vickatg[/eluser] i acknowledge Post a form with Jquery+Ajax - El Forum - 07-05-2011 [eluser]defectivereject[/eluser] as a note and to save you a LOT of time and effort use Code: $.ajax({ instead of on each form putting the data ID/Name values and setting variables. .serialize automatically does that for each field for you on submission |