Closed Bug 125670 Opened 23 years ago Closed 23 years ago

list changes by script trow 'onChange' event

Categories

(Core :: Layout: Form Controls, defect)

x86
Other
defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 112241

People

(Reporter: alex, Assigned: rods)

Details

Mozilla's JavaScript engine throws an "onChange" event whenever the content of a
form list element is changed by a separate function. According to the JavaScript
documentation, events _only_ occur if the form elements are manipulated by the
user, not by a script. -> Events mustn't be thrown if a form element is
manipulated by JavaScript.

Mozilla will enter into an endless loop. All other browsers I tested (Netscape
4.7x, InternetExlorer 5.0/6.0, Opera 5.12) worked fine!

Reproducability: every time

Steps to reproduce: execute the following source code


<script language="JavaScript1.2">
  function ChangeList( list )
  {
    alert( "I'm going to change the content of " + list.name + "! This will
throw a new onChange event -> you cannot escape me!");
    list.options[0].text = "New_00";
  };
</script>

<form action="ok.html" method="get">
  <select name="my_list" size="1" onChange="ChangeList( this );">
    <option>Empty_00</option>
    <option>Empty_01</option>
  </select>
  <input type=submit" value=" change selection for endless loop! ">
</form>
Reporter, always include your buildID since this bug
is a dupe of bug #112241 fixed on the trunk on 2002-01-28.

However, the patch didn't make 0.9.8.

If you're using 0.9.8 or a "pre 01-28 trunk", please mark
this bug as a duplicate of bug #112241.
In the meantime, reassigning to HTML Form Controls component for
parity with the probable dupe. This is an embedding issue, not a
JS Engine issue. JS Engine deals with lower-level functionality like 
Number(), String(), and Date() and is not aware of browser components. 
Assignee: rogerl → rods
Component: JavaScript Engine → HTML Form Controls
QA Contact: pschwartau → madhur

*** This bug has been marked as a duplicate of 112241 ***
Status: UNCONFIRMED → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.