Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

change onclick function() for table cell

Status
Not open for further replies.

Vadim

Programmer
Feb 5, 2002
75
US
I tried to change "onclick" function after some action:

document.all[cell].onclick=
function(){ rtvItem(Str, Sku, Seq, Desc , Reason, RaNum,
Markout, Recall, this.id, "UPD");};

But this cell still keeps old function parameters.
Is somebody may tell me what is wrong?
 
Look at this:


<table border="1" width="100%" id="table1">
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td onclick ="aaa()">wefwe</td>
<td>&nbsp;</td>
</tr>
</table>


<script language=javascript type=text/javascript>
function aaa()
{
alert("clicked");
}
</script>



That is better.

-bclt
 
What about this:
Code:
document.getElementById(cell).setAttribute("onclick", function(){ rtvItem(Str, Sku, Seq, Desc , Reason, RaNum, Markout, Recall, this.id, "UPD")});

Adam

¡ph ¥0u c4n r34d d¡5 ¥0u n33d 70 g37 l4¡d
 
This also works. This or propably these lines of code should be placed at onload event of the page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top