I've been looking up the new HTML5 form attributes in order to learn how to make pages for mobile devices. While reading, I've come across an 'autosave' attribute.
I've been testing it but nothing happened. What is it intended for? Is my code correct? Does it even relate to search, or have I misunderstood the MDN?
autosave
This attribute should be defined as a unique value. If the value of the type attribute is search, previous search term values will persist in the dropdown across page load.
My code:
<form method="POST">
<input type="search" name="fieldxxx" autosave="unique666" required="true" autocomplete="off"/>
<button type="submit">Search</button>
</form>
The search
input type was invented by Apple for Safari, before being proposed for standardization.
autosave
is/was an attribute of that, and was proposed for inclusion in HTML5 in 2008. According to the linked proposal it "specifies a name so recent searches can be used with any search field with the same autosave name."
But I can find no evidence that it was ever in the HTML5 spec. If it was in an editor's draft it did not last long. It is certainly not in any of the HTML specs in current use.