Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML5 PUT/DELETE methods not working in Chrome?

Tags:

I am trying to figure out why the put/delete methods, in an HTML5 enabled site, is not working with Chrome. From what I have searched for, it sounds like it has been working for some time with Chrome, so with that said I am just looking for a few pointers to narrow down my problem. Perhaps I am implementing the form wrong, perhaps my doctype is wrong, who knows.

So, the code looks like this:

<!DOCTYPE html>  <html>     <head>          <title>              some_resource         </title>      </head>      <body>    <div class="content">    <form method="put" action="/some_resource">     <div>      <input id="title" name="title" placeholder="The Resource Title" type="text" value="" autofocus />     </div>     <div>      <textarea id="body" name="body" placeholder="The Resource Body" required></textarea>     </div>     <div>      <input id="submit" name="submit" type="submit" value="Submit" />     </div>     <!-- Resource Settings -->     <ul>      <li>       <input id="listed" name="listed" type="checkbox" value="y" />      </li>      <li>       <input id="template" name="template" type="text" value="resource.html" />      </li>     </ul>    </form>    </div>      </body>  </html> 

Just a basic test for a form. Now I have tried it on the Latest Ubuntu Firefox (3.6.7), Opera (10.60 Internal), and the latest Linux Chrome Beta from Google (5.0.375.99 beta). None of them seem to send the proper put method to the server, when I submit the form. Now, I believe (not from any specific research) that Firefox has yet to support this, and that like a lot of HTML5, it is scheduled for the next version of FF. Opera I do not know about, but I often hear about it keeping pace with Chrome. So I am a bit confused.

When submitting the form, they go to the url: http://localhost:8080/some_resource?title=t&body=b&submit=Submit&template=resource.html. Note that, as expected, POST works just fine.

Now does anyone have any pointers to get the put method working? It could be possible that the beta for Linux simply hasn't been updated to that of the Windows variety (something I assume, is what people were talking about when i saw PUT working for Chrome), but I am really hoping it is an issue with my implementation.

Do servers have to support PUT/DELETE? (I'm using AppEngine Dev Server currently). I don't know. Hopefully someone has some ideas :)

Note: Other HTML5 features I have tested so far are working. Eg, in that form you can see autofocus and required attributes. Those are working as intended in Chrome.

Edit1: Just to clarify, I understand support for these is sketchy. As I replied to an answer earlier, I don't care about current support in other browsers. Currently Chrome is what I want to work, and I expect Firefox to work in the upcoming release (I don't know, I just hear them pushing HTML5 a lot), and I have no idea about Opera.

All of this is simply to test and learn the new wonderful world of HTML5 (Web Workers, localStorage, etc) and CSS3. I only care about bleeding edge browsers, which are matching bleeding edge technology.

like image 819
Lee Olayvar Avatar asked Jul 31 '10 16:07

Lee Olayvar


People also ask

Why are there no put and delete methods in HTML forms?

DELETE only makes sense if there is no payload, so it doesn't make much sense with forms either. At this point, it seems that the main reason why there is no support for these methods is simply that nobody has taken the time to write a comprehensive specification for it.

Does HTML form support delete?

The current HTML5 draft does not support PUT or DELETE in forms.


1 Answers

PUT and DELETE are no longer supported methods for the <form> tag. See HTML5 differences from HTML4 (19 Oct 2010)

like image 65
darasd Avatar answered Oct 14 '22 09:10

darasd