Personal tools
You are here: Home   Bugs   setAttribute does not work as intended with value as an attribute  
 
Document Actions

#24 — setAttribute does not work as intended with value as an attribute

State Unconfirmed
Release: 1.2 (Zope 2.10)
Area Client side framework and general
Issue type Bug
Severity Medium
Submitted by (anonymous)
Submitted on 2008-01-04
Responsible
Target release:
Return to tracker
Last modified on 2008-01-04
When you do setAttribute on a <input> and set the 'value' to something, the dom is changed but the browser's shown value is not refreshed.

ree tried out the following patch which does the job:
Index: dom.js
===================================================================
--- dom.js (revision 49328)
+++ dom.js (working copy)
 -206,6 +206,10 @@
         // we need to convert this to boolean.
         value = ! (value == '' || value == 'false' || value == 'False');
         node.checked = value;
+ } else if (attrname.toLowerCase() == 'value') {
+ // setting value on input does not update on FF,
+ // if setAttribute is used...
+ node.value = value;
     } else {
         node.setAttribute(attrname, value);
     }

That is do a node.value = value directly.
Steps to reproduce:
put an <input> field.
Change its value server or client side using setAttribute