Advertisement

08.08.2008 at 09:11AM PDT, ID: 23633167 | Points: 500
[x]
Attachment Details

onclick function in table data <td> element

Asked by ukapu2005 in JScript

I have a function function onSaveAndPrint(){}. The problem is that onclick event on tdElement is not
working....please help me as early as possible.

Please see the code in code snippetStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
for (int i=0; i < strFF.length; i++) { %>
    		printSelectArray[<%= i%>] = "<%= strFF[i]%>";
    		tmp += "<tr id='tr_<%=i%>'><td height='17px' nowrap id='td_<%=i%>'><%= strFF[i]%></td></tr>"; 
		  <%}
		  }catch (Exception e) { %>
		    printSelectArray = new Array();
	     <%} %>
         tmp += "</table>";  
         savePrintSelect.innerHTML = tmp;
         for (index in printSelectArray) {
           var trElement = dialogArguments[0].document.getElementById("tr_"+index);
          
           trElement.style.backgroundColor = '#CCCCCC';
           trElement.style.cursor = 'hand';
           trElement.style.fontWeight = 'normal';
           trElement.style.fontSize = '8pt';
           trElement.style.fontFamily = 'Verdana,sans-serif';           
           var tdElement = dialogArguments[0].document.getElementById("td_"+index);
           tdElement.onmouseover= "this.style.backgroundColor='#CED7EF';this.style.color='#000000'; this.style.border='1px solid #737994';";
           tdElement.onmouseout="this.style.backgroundColor='#CCCCCC';this.style.color='#000000'; this.style.border='1px solid #CCCCCC';";         
           tdElement.onclick = 'jonSaveAndPrint();'
         }
[+][-]08.08.2008 at 01:46PM PDT, ID: 22193511

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628