...

View Full Version : How I write this in |A|S|P ?



JANLEE
03-09-2006, 04:02 AM
Hi,

I have this script written in javascript.

Please, how I write this script in ASP?


<html>
<head>
<script type="text/javascript">

function concatColumn(colIndex){
var tableObj = document.getElementById('myTable');
var string = '';
var string2 = '';
colIndex--;
for(var no=0;no<tableObj.rows.length;no++){
string+=tableObj.rows[no].cells[colIndex].innerHTML;

}
for(var no=0;no<tableObj.cols.length;no++){
string2+=tableObj.cols[no].cells[colIndex].innerHTML;

}
alert(string);
alert(string2); How I do to list the lines?
}

</script>
</head>
<body>
<a href="#" onclick="concatColumn(1);return false">Column -1</a>
<a href="#" onclick="concatColumn(2);return false">Column -2</a>
<a href="#" onclick="concatColumn(3);return false">Column x</a>
<a href="#" onclick="concatColumn(4);return false">Column +1</a>
<a href="#" onclick="concatColumn(5);return false">Column +2</a>
<br><br>

<table id="myTable">
<TR>
<td>XDL
</td>
<td>SDF
</td>
<td bgcolor="#ffff00">MJK
</td>
<td>SDF
</td>
<td>RTY
</td>
</tr>
<tr>
<td>WER
</td>
<td>RTY
</td>
<td bgcolor="#ffff00">DFG
</td>
<td>WER
</td>
<td>QWE
</td>
</tr>
<tr>
<td>RTY
</td>
<td>MJK
</td>
<td bgcolor="#ffff00">SDF
</td>
<td>MJK
</td>
<td>RTY
</td>
</tr>
<tr>
<td>WER
</td>
<td>MJK
</td>
<td bgcolor="#ffff00">DFG
</td>
<td>MJK
</td>
<td>RTY
</td>
</tr>
<table>
</body>
</html>

Thank you

janlee

Roelf
03-09-2006, 08:38 AM
You don't. The function is a client side function. Referring to elements which are in the browser. ASP scripts are executed at the server, before the response is sent to the browser.

JANLEE
03-10-2006, 07:41 AM
Sure?

And if I have a text in a textarea Can I (like my example) separate it in columns?

Thanks

JLee



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum