Hi, I'm working on a simple, one field, form that works with AJAX. Every time I submit the form and then refresh the page, I get a 412 error (Precondition failed: The precondition on the request for the URL /user.html evaluated to false.
). Eventually this form will be AJAX, but right now, I'm just using jQuery to receive the click event on the submit button and then give me an alert. This is pretty simple and I've done things with forms just like this many times before. Any ideas on what's going on here?
I'm running the site locally on MAMP on Snow Leopard.
And to clarify, I don't get the error when I don't submit the form and refresh, so it definitely has something to do with either the html or the jQuery. (but I don't see how either of those could produce this error).
EDIT: The html code:
<form id="add-form" method="post" action="">
<input type="text" name="add-input" value="http://example.com" />
<input type="submit" name="add-submit" value="Add" />
</form>
THe jQuery:
$(document).ready(function() {
$('input[type="submit"]').click(function() {
link = $('input[name="add-input"]').val();
alert(link);
return false;
});
});