Usuwanie podpowiedzi dla pola input - autocomplete off
Skrypt wyłącza domyÅ›lne podpowiedzi dla pól input.
Ponieważ autocomplete="off" nie dziaÅ‚a we wszystkich przeglÄ…darkach i powoduje błąd walidacji w3c, można użyć tego kodu który dziaÅ‚a i nie powoduje błędu walidacji.
Listing
<html>
<head>
<script type="text/javascript">
function init() {
if (!document.getElementById) return false;
var f = document.getElementById('auto_off');
var u = f.elements[0];
f.setAttribute("autocomplete", "off");
u.focus();
}
</script>
</head>
<body onload='init()'>
<form id="auto_off">
<input type="text" name="login" />
</form>
</body>
</html>
<head>
<script type="text/javascript">
function init() {
if (!document.getElementById) return false;
var f = document.getElementById('auto_off');
var u = f.elements[0];
f.setAttribute("autocomplete", "off");
u.focus();
}
</script>
</head>
<body onload='init()'>
<form id="auto_off">
<input type="text" name="login" />
</form>
</body>
</html>
Dodano przez: igor
Ranga: Administrator serwisu Punktów: 28716
Ranga: Administrator serwisu Punktów: 28716
Komentarze użytkowników
:: Losowe artykuły

:: Wymiana linków

Modowe inspiracje |
Android Gry i Aplikacje |
ZaplanujTransport.pl: Przeprowadzki, transport, aukcje |
Logo dla firmy |
Change Tires - Car Weather Forecast Reminder |
Zend Framework 3. Developer's Guide |
IT Books Reviews and Programming: JS, JAVA, PHP, ANDROID, CSS |
Katalog roślin |
Programming articles of: JAVA, PHP, C++, Pyth, JavaScript and so on..