Use childNodes instead of children
authorJoey Schulze <joey@infodrom.org>
Wed, 24 Mar 2010 19:49:05 +0000 (20:49 +0100)
committerJoey Schulze <joey@infodrom.org>
Wed, 24 Mar 2010 19:49:05 +0000 (20:49 +0100)
lib/functions.js

index 8c983b5..f3f7cb7 100644 (file)
@@ -115,10 +115,10 @@ function form_init()
 
     if (!form) return;
 
-    for (var i=0; i<form.children.length; i++)
-       if (form.children[i].tagName.toLowerCase() == 'input'
-           && form.children[i].type.toLowerCase() == 'password')
-           form.children[i].value = '';
+    for (var i=0; i < form.childNodes.length; i++)
+       if (form.childNodes[i].nodeName.toLowerCase() == 'input'
+           && form.childNodes[i].type.toLowerCase() == 'password')
+           form.childNodes[i].value = '';
 }
 
 function select_update(id, options, empty)