Topic: overriding onClick events. |
|
---|---|
Author | Thread |
Nervous Wreck (II) Inmate From: |
posted 09-19-2006 13:11
ok, so if I have an onclick event for a table row like this..how can I 'override' the <tr onclick:dothis();> and run the 'dothat();' functions in the button and the div? code: <tr onclick="dothis();"> <td>stuff</td> <td>more stuff</td> <td><input type=button onclick="dothat();" value="I want this function to run, not the one in the tr tag"></td> <td> <div id="someid" onclick="dothat2();" value="I want this function to run, not the one in the tr tag"> ---some stuff in div. </div> </td> </tr>
|
Bipolar (III) Inmate From: Umeå, Sweden |
posted 09-19-2006 13:44
Well, you can try this: code: <input type=button onclick="return dothat();" ..>
code: function dothat(){ ... return false; }
|
Nervous Wreck (II) Inmate From: |
posted 09-19-2006 14:39
any idea how I would use the "W3C methods Event.stopPropagation and Event.preventDefault and the corresponding properties in iew, Event.cancelBubble and Event.returnValue" in the above context? |
Maniac (V) Inmate From: |
posted 09-19-2006 14:53
One idea worth 12'000 links or so: |
Paranoid (IV) Inmate From: Norway |
posted 09-19-2006 15:04 |