473,508 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

show table rows

Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
plz help me..I want it very argent.

Thanks in advance...

May 15 '07 #1
11 1921
sanju wrote:
Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
plz help me..I want it very argent.

Thanks in advance...
Hi,

If you are really new to JavaScript, don't expect you'll solve your problem
with a posting to this ng.
The reason is simply that is will be difficult for anybody to help you if
you know nothing about javascript.

eg: Expect answers/questions like:
- Give every td an unique ID.
- what are the values in the radiogroup? and what is their name?
etc.

Probably all over your head and might very well result in a lot more
timeloss for you trying to understand what goes wrong.

The good news is: What you are asking for is very basic.
I would advise you to hire a JavaScript programmer for one day and fix your
app as you desire.
(s)he can probably also fix/build a few other things if any good in 1 day.
;-)
just my 2 cent.
Good luck.

Regards,
Erwin Moller
May 15 '07 #2
Erwin Moller wrote on 15 mei 2007 in comp.lang.javascript:
sanju wrote:
>Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
plz help me..I want it very argent.

Thanks in advance...

Hi,

If you are really new to JavaScript, don't expect you'll solve your
problem with a posting to this ng.
The reason is simply that is will be difficult for anybody to help you
if you know nothing about javascript.
Another reason is that we don't do Sanju's school assignment.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 15 '07 #3
ASM
sanju a écrit :
Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
You must hide by JS each row of 2nd table

function hid() {
var t2 = document.getElementById('table2');
t2 = t2.getElementsByTagName('TBODY')[0].rows;
for(var i=0; i<t2.length; i++)
t2[i].style.display = 'none';
}

Then you must to have a function to see what is checked

function chck() {
var C = new Array();
var k = 0;
var t1 = document.getElementById('table2');
t1 = t1.getElementsByTagName('TBODY')[0].rows;
for(var i=0; i<t2.length; i++)
if(t2[i].getElementsByTagName('INPUT')[0].checked) {
C[k] = i;
k++;
}
return C;
}

And something to reveal correct rows :

function myRows() {
hid();
var C = chck();
var t2 = document.getElementById('table2');
t2 = t2.getElementsByTagName('TBODY')[0].rows;
for(var i=0; i<C.length; i++)
t2[C[i]].style.display = '';
}

<html>
<script type="text/javascript">
var t1, t2;
function init() {
t1 = document.getElementById('table1');
t1 = t1.getElementsByTagName('TBODY')[0].rows;
t2 = document.getElementById('table2');
t2 = t2.getElementsByTagName('TBODY')[0].rows;
hid();
}
onload = init;

function hid() {
for(var i=0; i<t2.length; i++) {
t2[i].style.display = 'none';
t2[i].getElementsByTagName('INPUT')[0].checked=false;
}
}

function chck() {
var C = new Array();
var k = 0;
for(var i=0; i<t1.length; i++)
if(t1[i].getElementsByTagName('INPUT')[0].checked) {
C[k] = i;
k++;
}
return C;
}

function myRows() {
hid();
var C = chck();
for(var i=0; i<C.length; i++) {
t2[C[i]].style.display = '';
// t2[C[i]].getElementsByTagName('INPUT')[0].checked=true;
}
}

</script>
<form>
<table id="table1" border="1" width="90%" cellspacing="2">
<tr>
<td><input type=checkbox onclick="myRows()"></td>
<td>_Row_1_Cell_2_</td>
<td>_Row_1_Cell_3_</td>
</tr>
<tr>
<td><input type=checkbox onclick="myRows()"></td>
<td>_Row_2_Cell_2_</td>
<td>_Row_2_Cell_3_</td>
</tr>
<tr>
<td><input type=checkbox onclick="myRows()"></td>
<td>_Row_3_Cell_2_</td>
<td>_Row_3_Cell_3_</td>
</tr>
<tr>
<td><input type=checkbox onclick="myRows()"></td>
<td>_Row_4_Cell_2_</td>
<td>_Row_4_Cell_3_</td>
</tr>
<tr>
<td><input type=checkbox onclick="myRows()"></td>
<td>_Row_5_Cell_2_</td>
<td>_Row_5_Cell_3_</td>
</tr>
</table>

<table id="table2" border="1" width="90%" cellspacing="2">
<tr>
<td><input type=radio name=rad></td>
<td>_Row_1_Cell_2_</td>
<td>_Row_1_Cell_3_</td>
</tr>
<tr>
<td><input type=radio name=rad></td>
<td>_Row_2_Cell_2_</td>
<td>_Row_2_Cell_3_</td>
</tr>
<tr>
<td><input type=radio name=rad></td>
<td>_Row_3_Cell_2_</td>
<td>_Row_3_Cell_3_</td>
</tr>
<tr>
<td><input type=radio name=rad></td>
<td>_Row_4_Cell_2_</td>
<td>_Row_4_Cell_3_</td>
</tr>
<tr>
<td><input type=radio name=rad></td>
<td>_Row_5_Cell_2_</td>
<td>_Row_5_Cell_3_</td>
</tr>
</table>
</form>
</html>
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 15 '07 #4
Evertjan. wrote:
Erwin Moller wrote on 15 mei 2007 in comp.lang.javascript:
>sanju wrote:
>>Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
plz help me..I want it very argent.

Thanks in advance...

Hi,

If you are really new to JavaScript, don't expect you'll solve your
problem with a posting to this ng.
The reason is simply that is will be difficult for anybody to help you
if you know nothing about javascript.

Another reason is that we don't do Sanju's school assignment.
LOL, yeah. ;-)
Could also be true.

BTW: ASM wrote a lengthy answer that looks good.
However, I wonder if the OP can use it...

Regards,
Erwin Moller
May 15 '07 #5
ASM
Erwin Moller a écrit :
>
BTW: ASM wrote a lengthy answer that looks good.
Tested in FF
However, I wonder if the OP can use it...
I certainly will not give commented code in first answer.
He will have to do it himself, showing by that he understand.

If he doesn't understand sg he'll can come back and ask.

--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 15 '07 #6
ASM wrote:
Erwin Moller a écrit :
>>
BTW: ASM wrote a lengthy answer that looks good.

Tested in FF
>However, I wonder if the OP can use it...

I certainly will not give commented code in first answer.
He will have to do it himself, showing by that he understand.

If he doesn't understand sg he'll can come back and ask.
Looks like Sanju is too busy to check out your excellent answer...

Regards,
Erwin Moller
May 16 '07 #7
ASM
Erwin Moller a écrit :
ASM wrote:
>>
If he doesn't understand sg he'll can come back and ask.
He could : 1st part of what I've given is wrong (can't work)
Looks like Sanju is too busy to check out your excellent answer...
:-))

I do not wait something from those who question
--
Stephane Moriaux et son (moins) vieux Mac déjà dépassé
Stephane Moriaux and his (less) old Mac already out of date
May 16 '07 #8
On May 15, 7:27 pm, "Evertjan." <exjxw.hannivo...@interxnl.netwrote:
Erwin Moller wrote on 15 mei 2007 in comp.lang.javascript:


sanju wrote:
Hi all,
I am new in the world of javascript. Someone plz help me.
I have two tables containing 30 rows each. In first table there is
checkbox and in the second table there is radio buttons ahead each
row. If i select 5th & 6th row from first table then it should show
only the 5th & 6th row from the second table. The rows are same in
both table. Likewise the rows i select from first table should only
display from the second table..
plz help me..I want it very argent.
Thanks in advance...
Hi,
If you are really new to JavaScript, don't expect you'll solve your
problem with a posting to this ng.
The reason is simply that is will be difficult for anybody to help you
if you know nothing about javascript.

Another reason is that we don't do Sanju's school assignment.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)- Hide quoted text -

- Show quoted text -
Dont act very smart!!!! r u owner of this group?
i dont like to give answer to ur foolish thing...dont think abt
me...think abt ur self, it will help u in future

May 17 '07 #9
sanju wrote on 17 mei 2007 in comp.lang.javascript:
If you are really new to JavaScript, don't expect you'll solve your
problem with a posting to this ng.
The reason is simply that is will be difficult for anybody to help you
if you know nothing about javascript.

Another reason is that we don't do Sanju's school assignment.

Dont act very smart!!!! r u owner of this group?
i dont like to give answer to ur foolish thing...dont think abt
me...think abt ur self, it will help u in future
You seem to mistake usenet for sms, go and learn first, Sanju.
In your angryness you expose yourself.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 17 '07 #10
Evertjan. wrote:
You seem to mistake usenet for sms, go and learn first, Sanju.
In your angryness you expose yourself.
Heh. "Angryness?" ;)

--
-Lost
Remove the extra words to reply by e-mail. Don't e-mail me. I am
kidding. No I am not.
May 17 '07 #11
-Lost wrote on 18 mei 2007 in comp.lang.javascript:
Evertjan. wrote:
>You seem to mistake usenet for sms, go and learn first, Sanju.
In your angryness you expose yourself.

Heh. "Angryness?" ;)
Y? [~ Why?]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
May 18 '07 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
27127
by: Harry | last post by:
I want to provide a drill down facility for the users - the plan is to intially display a table with summary rows containing results of previous selected search criteria. In each summary row you...
3
7741
by: KathyB | last post by:
Hi, totally new to the div show/hide thing. I have some rows in a table. When I first load the page, I only want to see divs where the divID=ForView. When I load now, I see BOTH rows...even...
20
2544
by: WindAndWaves | last post by:
Hi Gurus I was wondering if you can send me in the right direction: I have a table with about 300 rows. I want to make all of them invisible and when a user enters a code in a form then make...
2
6992
by: Mateo | last post by:
Hi! I have a litle JS problem.... I'm trying to make show/hide table JS function, but my show/hide table function works only on IE.... It works in mozilla partially. Actually,every time when I...
3
1946
by: evanburen | last post by:
I'm using this to hide rows in a table created from ASP. This works well but I would like to also be able to 'Show' the records again that there hidden by removeEvents( ). Thanks. function...
11
7999
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to...
2
7401
by: agphoto | last post by:
when we do mysql_query with while and mysql_num_rows() together then while do no show the first row from table in database.. example : <? $conn = mysql_connect($DBhost,$DBuser,$DBpass) or...
18
7525
by: Liquidtouch | last post by:
I have been searching on this for awhile and cant find anything and playing around with it got me no where. I will start with what I am after and then explain what I have. I have a table with 3...
2
11512
by: Sudhakar | last post by:
hi I am using MySQL - 4.1.22 when i use the following sql query $result = mysql_query("SHOW tablename STATUS FROM databasename;"); i have also tried = $result = mysql_query("SHOW tablename...
0
7226
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7125
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7328
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7049
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5055
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4709
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3199
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1561
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
422
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.