In trying to track down the last holdout in me getting a successful simple
run through my site, I found that the JavaScript Form host does not add
radio inputs to the elements collection. I looked but could find no obvious
reason as to why this is the way it is. Radio inputs are part of the
elements collection in IE6 (I made no attempt to verify other browsers, so
maybe that is the reason, although the site is supposedly certified on
NS4.7). I amended my working copy of the code
(com.gargoylesoftware.htmlunit.javascript.host.Form.initialize()) as
follows:
//if( htmlElement instanceof HtmlRadioButtonInput ) {
// radioButtons.add(htmlElement);
//}
//else {
final String className =
getClassNameForFormElement(htmlElement);
final SimpleScriptable jsElement = makeJavaScriptObject(
className );
jsElement.setHtmlElement(htmlElement);
allJsElements.add(jsElement);
defineProperty(name, jsElement, attributes);
//}
-- just commenting out the check. This did not cause any obvious effects to
my tests (other than the JavaScript now appears to work as it does in the
browser). What does/would this break?
Any enlightenment would be much appreciated.
Cort
|