newphper Posted February 16, 2010 Share Posted February 16, 2010 Hi Guys, I'm brand new to AJAX, trying to find my feet and am obviously having some trouble doing so. I have a PHP form, it is quite long. On one part of the form I ask for contact information. I have a name textarea, a surname textare and some checkboxes regarding occupation. After the person has filled this part of the form in, I would like them to either leave it as is OR press the 'Add New Contact' button which will not refresh the page, but will submit the entered data to my database and allow them to continue with the rest of the form. Anything will help, even if you can point me to a good tutorial? Thanks!! Quote Link to comment https://forums.phpfreaks.com/topic/192250-ajax-add-new-contact-button/ Share on other sites More sharing options...
gamblor01 Posted February 16, 2010 Share Posted February 16, 2010 Take a look at my post here: http://www.phpfreaks.com/forums/index.php/topic,287155.0.html I was trying to accomplish something similar -- I wanted to be able to add/delete rows in a MySQL table. The rows in that table are displayed in an HTML table. However, when the add/delete was executed, I wanted the page to update the HTML table without having to do a full refresh. You can probably tweak my code there (get rid of the if statements since you can assume it's an addition, and then remove the stuff at the bottom of the PHP code that displays the table. Instead, you could just display a "success" message), or at least get a good idea of how to do things. The AJAX request is sent over using HTTP GET. I'm about to create a new thread that shows how to transform a GET request into a POST request. It might be useful to check that out too. Quote Link to comment https://forums.phpfreaks.com/topic/192250-ajax-add-new-contact-button/#findComment-1013341 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.