Chrome not sending POST requests on localhost, Firefox works fine

Posted by AP257 on Stack Overflow See other posts from Stack Overflow or by AP257
Published on 2010-03-02T19:39:05Z Indexed on 2010/05/10 14:04 UTC
Read the original article Hit count: 289

Filed under:
|
|

I have copied the simple Django forms example exactly, running on localhost. The basic contact form example should submit a POST request when you click the Submit button.

I'm running Chrome on Mac Snow Leopard, and whenever I submit the form, the page simply reloads with an empty form: I can see from the runserver output that it's not sending a POST - instead it's sending a GET request.

If I open the same page in Firefox on Mac Snow Leopard, and submit the form, I can see it's sending a POST request (as it should be).

Looking at the source in Chrome, the form definitely says method="post".

<form action="/contact/" method="post"> 
<p><label for="id_subject">Subject:</label> <input id="id_subject" type="text" name="subject" maxlength="100" /></p> 
<p><label for="id_message">Message:</label> <input type="text" name="message" id="id_message" /></p> 
<p><label for="id_sender">Sender:</label> <input type="text" name="sender" id="id_sender" /></p> 
<p><label for="id_cc_myself">Cc myself:</label> <input type="checkbox" name="cc_myself" id="id_cc_myself" /></p> 
<input type="submit" value="Submit" /> 
</form> 

External sites with POST forms seem to work OK in Chrome.

In addition, if I fill the form in incorrectly, in Chrome the page just reloads, with a GET request, as before; in Firefox the form gets validated, as it should.

I've tried with other POST forms on localhost and got the same result.

I know Chrome for Mac has its quirks, but what on earth is going on?

© Stack Overflow or respective owner

Related posts about google-chrome

Related posts about firefox