Welcome to WebmasterWorld Guest from

Forum Moderators: open

Using AJAX to Submit a Form to PHP

11:33 pm on Dec 20, 2017 (gmt 0)

Preferred Member

10+ Year Member

joined:Apr 28, 2003
posts: 486
votes: 1

I am using the below code to try to submit a form with id="profileForm" to a page named "process_form.php" where the values of the form get inserted into a mysql database. But I cannot get the code to work. I've been working at this for some time and tried a lot of revisions after researching on Google and here on WW. Many of the examples look extremely similar to my code so I dont know what I'm doing wrong.

<script type="text/javascript">

var dataString = $("#profileForm").serializeArray();

url: 'process_form.php',
data: dataString,
success: function(data){
error:function (data){

It seems like the code isn't even calling "process_form.php" successfully.