[ htmlunit-Bugs-1587962 ] setChecked outside <form> element

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[ htmlunit-Bugs-1587962 ] setChecked outside <form> element

Bugs item #1587962, was opened at 2006-10-31 15:12
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: 1.8
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Martin Jansa (jamae)
Assigned to: Nobody/Anonymous (nobody)
Summary: setChecked outside <form> element

Initial Comment:
If <input type="radio"... appears outside any <form>
element and some javascript code wants to set checked
property, it leads to code:

public void setChecked( final boolean isChecked ) {
  final HtmlForm form = getEnclosingForm();
  final boolean changed = isChecked() != isChecked;

  if( isChecked ) {
    try {
      form.setCheckedRadioButton( getNameAttribute(),
getValueAttribute() );
    catch( final ElementNotFoundException e ) {
      // Shouldn't be possible
      throw new IllegalStateException("Can't find this
element when going up to the form and back down.");

And "final HtmlForm form = getEnclosingForm();"
returns null, than whole javascript ends with

At least there should be used getEnclosingFormOrDie
function. And maybe input fields outside form could be



You can respond by visiting:

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
HtmlUnit-develop mailing list
[hidden email]