From a3142c377a9e199db62a08874073abfb317b697d Mon Sep 17 00:00:00 2001 From: Alexey Verkhovsky Date: Sun, 23 Jan 2005 18:23:27 +0000 Subject: [PATCH] prevent password managers from messing up edit_web form --- app/views/wiki/edit_web.rhtml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/app/views/wiki/edit_web.rhtml b/app/views/wiki/edit_web.rhtml index e45199c2..0477233f 100755 --- a/app/views/wiki/edit_web.rhtml +++ b/app/views/wiki/edit_web.rhtml @@ -7,10 +7,10 @@ Ex: the address "rails" gives URLs like /rails/show/HomePage. -
+
Name:    Address: - (Letters & digits only) + (Letters and digits only)

Specialize

@@ -20,7 +20,7 @@ Additions to the stylesheet take precedence over the existing styles. Hint: View source on a page you want to style to find ID names on individual tags. See styles >>
-
+
Markup:    - Verify: + Password:    + Verify:

Publish read-only version of this web (<%= @web.name %>)

@@ -67,7 +67,7 @@

Enter system password - + and

@@ -126,4 +126,17 @@ function validateSetup() { return true; } + +// overriding auto-complete by form managers +// code by Chris Holland, lifted from +// http://chrisholland.blogspot.com/2004/11/banks-protect-privacy-disable.html +if (document.getElementsByTagName) { + var inputElements = document.getElementsByTagName("input"); + for (i=0; inputElements[i]; i++) { + if (inputElements[i].className && (inputElements[i].className.indexOf("disableAutoComplete") != -1)) { + inputElements[i].setAttribute("autocomplete","off"); + }//if current input element has the disableAutoComplete class set. + }//loop thru input elements +} +