Version: (using KDE KDE 3.3.2) Installed from: RedHat RPMs Compiler: 3.4.2 from Fedora 3 OS: Linux Hi, input elements with no value attribute have a value that causes problems to JavaScript - for example it does not match even simple regexp like ".*". After entering some value or initializing it with value="", it works fine. I will attach a test case. Jan
Created attachment 9769 [details] Test case The first text field is a reg exp, the second is a text to match it.
Reproduceable with 3.4rc1, works fine in firefox. Since this seems to be javascript related I moved it-
HTMLInputValueImp::value() (html_formimpl.cpp) should never return a null DOMString(). Right now an invalid JS string object is created.
CVS commit by porten: value() should never return a null string. BUGS:99970 M +6 -4 html_formimpl.cpp 1.421.2.3 --- kdelibs/khtml/html/html_formimpl.cpp #1.421.2.2:1.421.2.3 @@ -1559,10 +1559,12 @@ DOMString HTMLInputElementImpl::value() } + DOMString val = m_value; // It's important *not* to fall back to the value attribute for file inputs, // because that would allow a malicious web page to upload files by setting the // value attribute in markup. - if (m_value.isNull() && m_type != FILE) - return getAttribute(ATTR_VALUE); - return m_value; + if (val.isNull() && m_type != FILE) + val = getAttribute(ATTR_VALUE); + + return val.isNull() ? DOMString("") : val; }