Autocomplete attribute not passed XHTML 1.0 Transitional validation, why?

I am trying to clear my xhtml check - I am launching my pages through the W3C validator. For some mysterious reason, it does not pass input fields with the attribute autocomplete = "off":

<input name="kwsearch" id="sli_search_1" type="text" autocomplete="off" onfocus="if(this.defaultValue==this.value) this.value='';"
            onblur="if(this.value=='')this.value=this.defaultValue;" class="searchbox" value="Search" />

I am using this doctype:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

And this is a validation error:

Row 410, Column 81: No AutoFill Attribute

... li_search_1 "type =" text "autocomplete =" off "onfocus =" if (this.defaultValue == thi ...

I thought it was good with the W3C, but maybe it is still in the "presentation" phase? http://www.w3.org/Submission/web-forms2/#autocomplete

Thoughts?

+3
source share
5

- HTML 4/XHTML. , autocomplete .

, HTML 4/XHTML - JavaScript. , , , .

+5

autocomplete - HTML5, HTML5, .

+5

W3C -, XHTML. , DTD - .

+1

( ), doctype, XHTML 1.1 :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" [ <!ATTLIST form autocomplete (on|off) #IMPLIED> ]>

0

. , , javascript ON THE PAGE, , window.onLoad $(document).ready(), no-browser-autocomplete. , autocomplete="off" .

, javascript.

, , , , , , , dom , , , Firefox ( ).

So, this is at the beginning of one of the javascript files that I include in my application layout:

//this needs to run BEFORE all of the loaded/ready events fire, that why it not in the dom.ready function
$(".no-browser-autocomplete").attr("autocomplete", "off");

$(function(){ 
  //dom ready
});
0
source

Source: https://habr.com/ru/post/1738500/


All Articles