I want to send data from a form to a database. Here is the form I am using:
<form name="foo" action="form.php" method="POST" id="foo">
<label for="bar">A bar</label>
<input id="bar" name="bar" type="text" value="" />
<input type="submit" value="Send" />
</form>
Normally, you would submit the form, but doing so causes the browser to reroute. Is it possible to collect all of the form's data and send it to a PHP script (like form.php) using jQuery and Ajax?