The autocomplete attribute and web documents using XHTML: Difference between revisions

Jump to navigation Jump to search
Line 198: Line 198:
</html>
</html>
</pre></blockquote>
</pre></blockquote>
Edit by FunkyRes - mpeters@mac.com
I'm sorry, but this wiki page is incorrect. It is easier in xhtml to add an attribute than it is in html.
xhtml makes it very easy to do this. I do it.
<blockquote><pre>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [
<!ATTLIST form autocomplete CDATA #IMPLIED>
]>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
</pre></blockquote>
Note the magic in the DTD declaration -
<blockquote><pre>
[
<!ATTLIST form autocomplete CDATA #IMPLIED>
]
</pre></blockquote>
With that, my xhtml properly validates, no need to create a custom DTD.
Only gotcha is that you must send the application/xhtml+xml header with the document, but if you are using xhtml, you should be sending that header anyway.
Someone with better writing skills than me should properly update this page so that it presents things in a factual manner.


=== Authors who want to write XHTML 1.0, but use content negotiation to serve XHTML 1.0 as text/html (i.e. tag soup) to user agents that don't support XHTML ===
=== Authors who want to write XHTML 1.0, but use content negotiation to serve XHTML 1.0 as text/html (i.e. tag soup) to user agents that don't support XHTML ===
2

edits

Navigation menu