Trouble POSTing form with AJAX

nicoh

New Member
I'm trying to POST a form from a submit button, but when the button is pressed the page reloads and the URL is changed (includes the submitted data). Here's the AJAX\[code\]<head> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $(document).ready(function() { $('form#submit_boxes').submit(function() { $.ajax({ type: 'POST', url: 'form_data.php', data: this.html(data), success: success, dataType: dataType }) return false; }); }); </script></head>\[/code\]Here is the form I'm trying to submit\[code\] <form action="#" id = "submit_boxes"> <input type= "submit" name="submit_value"/> <input type="textbox" name="new_input"> </form>\[/code\]Say I submit "test", the page reloads to\[code\]http://localhost/dynamicbox?submit_value=http://stackoverflow.com/questions/15622016/Submit&new_input=test#\[/code\]
 
Back
Top