Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2004, 01:31 AM
Authorized User
 
Join Date: Sep 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Default Rows / html control with the same id

In my JSP page, I am using a 'for' loop to display certain amount of records. The code snippet is as below:

Code:
<%
   int maxRow = 3;
   for (int i = 0; i < maxRow; i++) {
%>

   <tr id="rowID">
      <td></td>
      <td></td>
   </tr>

<%
   }
%>
Since the 'maxRow' is 3, I will get 3 rows with id = rowID. Now, instead of using jsp expression tag (var rowNum = <%= maxRow %>), is it possible that we could use javascript method to get the total number of row with id = rowID ?

Thanks for reply.

 
Old November 4th, 2004, 05:50 AM
Friend of Wrox
 
Join Date: Oct 2004
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hiii Muklee

yes you can get it through
obj=document.getElementById("rowID")

totalrow=obj.length

Hope this will help you
Cheers!!!

vinod





Similar Threads
Thread Thread Starter Forum Replies Last Post
sql - concating columns for rows with same ID yuvalk SQL Server 2000 6 September 26th, 2006 10:47 AM
Converting an HTML Server Control to HTML Control gratisaccount ASP.NET 1.0 and 1.1 Basics 2 August 7th, 2006 12:29 AM
select Max 2 rows for each ID veeruu SQL Language 1 January 31st, 2006 05:08 AM
html control with same id and name ??? muklee Javascript 1 October 22nd, 2004 12:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.