Chrome not sending POST requests on localhost, Firefox works fine - firefox

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?

This is likely being caused by Chrome treating each file:// URL as a different domain. Try launching Chrome with the --allow-file-access-from-files option and see if that helps.
Update: You'll have to close all existing Chrome instances and launch a fresh instance with that option to notice any difference.

Related

AMP form issue in a MVC framework

I am having an issue with a form using AMP.
The form works perfectly on a standard amp html page - the button is clicked and the search.php is triggered.
<form method="post" action-xhr="search.php" target="_top">
<input name="query" placeholder="search" id="query" size="40" value="">
<button type=submit class="btn-search"><amp-img ></amp-img></button>
<input type=hidden name=search value=1>
</form>
Then the exact same code (including all the includes, etc) on the MVC framework I am using doesn't work. The button is clicked and nothing happens.
Source codes on both are identical when viewing page source.
Should this not be happening - the specific MVC framework I am using possibly has an issue with this?
Or is it due to it being MVC, the view (header.twig) has the form on the not working version. Would the php code from search.php go into the controller?
Any help would be greatly appreciated!

AJAX call to PHP not working yields a blank page

We are implementing the "forget password" feature for our website.
We are usign HTML, JQquery mobile and AJAX .
we have a main file, which has the hyperlink for the forget password using the '' tag.
The password.html has form elements as below:
<form method ="post" id="forget" action="somefile.php" >
<h4>Enter your login email to change your password..</h4>
<label for="email" class="ui-hidden-accessible">Email:</label>
<input type="email" name="email" id="email" value="" placeholder="email" data-theme="a" />
<input type="submit" value="Submit" data-theme="b" />
</div>
</form>
The php file validates the email and sends the response in JSON format , which we are handling through a ajax call.
The problem is after hitting on "submit" in the password.html, we are able to retreive the data from the php file(able to see in network tab of browser) but it does not display on the frontend.
The browser is navigating to the php file (which it should not) and a blank page is being displayed.
Ps: When we directly load the password.html in the browser the behaviour is absoultely fine , but when we are navigating from the main file usign the hyperlink to password.html then this problem occurs.

chrome rewrite ajax response with change close tag position

When i test my web site today.I can't submit the form .I checked the ajax response in chrome tools under network.
The HTML like this
<form><input type="image" /></form>
Actually the source in chrome tools under elements is
<form></form><input type="image" />
It's only happened under chrome. (IE and safari is work well)
What i can do now?
Try this
<form><input name="image" /><input type="image" /></form>

Search-form action attribute with Advanced AJAX Page Loader wordpress plugin returns "more than one title tag on the page.." warning in debug mode

I'm trying to enable search functionality of the Advanced AJAX Page Loader plugin on a custom wordpress theme I'm building, but after I enter keyword into search and hit enter, loader.gif keeps on spinning and I get this message in debug mode : "WARNING: You seem to have more than one title tag on the page, this is going to cause some major problems so page title changing is disabled". It also passes the url of the website twice into the address bar and I believe this has something to do with the action attribute that's being passed by the form.
This is the site in question: http://natalija.co.nf
I left the debug mode of the AAPL plugin on for now
This is my searchform.php code:
<form method="get" id="searchform" class="searchform" action="<?php bloginfo('url'); ?>">
<input type="submit" id="searchsubmit" value="" class="btn" />
<input type="text" size="10" name="s" id="s" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>
</form>
I managed to ajaxify the theme with this plugin but I 'm having trouble getting the search to work properly so I was wondering if anyone here can help me out with this? It is driving me crazy.
I solved it. The code in search.php needs to be wrapped with a div class="searchform".

Safari 5 bug - Radio button's checked="checked" attribute is ignored when loaded via AJAX

Strange bug with Safari happening when a radio button input is loaded via AJAX. The relavent code is
<input type="radio" name="team" value="231" style="width:auto;" checked="checked"/>Team 1
<input type="radio" name="team" value="232" style="width:auto;"/>Team 2
When this code is loaded with plain old html, the first radio button is checked as it should be. But if the same exact code is loaded via ajax, Safari doesn't actually show any indication it is checked, even though the checked="checked" attribute is there in the source.

Resources