views:

159

answers:

1

It is indeed quite unfortunate that my client still uses IE6. using jquery 1.4.2

The problem is that I open a window using a click event and do some edit operation in the new window. I have a 'change' event attached to the row of a table which has input fields. Now when the window loads for the first time and I make a change in the input for the FIRST time, the change event does not fire. however, on a second try it starts working. I have noticed that I e.g. I run a dummy page, i.e. create a new page(i work with visual studio) and run that page individually , the 'change' event works just fine.

what it going on? and what can i do, besides going back to 1.3.2 (by the way that doesn't work either, but haven't fully tested it yet)

<!--HTML-->

<table id="tbReadData">
<tr class="nenDataRow" id="nenDr2">
 <td>
 <input type="text" class="nenMeterRegister"  value="1234" />
  </td>
<tr />
<table>

<script type="text/javascript">
$(document).ready(function(){
 $('#tbReadData').find('tr').change(function() {
alert('this works');
}
});
</script>
A: 

Is that HTML correct? The row is not being closed.

<table id="tbReadData">
<tr class="nenDataRow" id="nenDr2">
 <td>
 <input type="text" class="nenMeterRegister"  value="1234" />
  </td>
</tr>
<table>

Also, the JavaScript is incorrect. It is missing a closure.

<script type="text/javascript">
$(document).ready(function(){
    $('#tbReadData').find('tr').change(function() {
            alert('this works');
        }); // added );
});
</script>
Jonathan
yes it is correct. It's just been posted in a hurry. don't worry about it though, i was using 1.4.1 and when I used the latest version of JQuery 1.4.2, and the bloody thing worked.