Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2005
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation How I write this in |A|S|P ?

    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

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    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.
    I am the luckiest man in the world

  • #3
    Regular Coder
    Join Date
    May 2005
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Sure?

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

    Thanks

    JLee


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •