473,504 Members | 13,830 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

select fullrow

Jon
Hi all

Looking for a way to select the fullrow when i click on LAG 3
So it marks all of LAG 3 for July, August, September

If I select LAG 4 it'll select of LAG 4 in the different months

It would very nice if there is a way with Javascript
Follow the link below

http://www.johak.se/schema/index.html
I'am pretty good with Visual Basic 6, and html
But no experience with Javascript
--

Mvh
Jon

jo*************@comhem.se
Jul 23 '05 #1
4 1172
Ivo
"Jon" typed
Looking for a way to select the fullrow when i click on LAG 3
So it marks all of LAG 3 for July, August, September
If I select LAG 4 it'll select of LAG 4 in the different months

It would very nice if there is a way with Javascript
Follow the link below
http://www.johak.se/schema/index.html


For example:
<script type="text/javascript">
function hiliteTR(el) {
var cel=el.cells;
var c=cel[0].style.background;
for (var i=cel.length;i--;)
cel[i].style.background= (c=='gold') ? 'none' : 'gold';
}
</script>

This function can be called by adding a so-called onclick event handler,
either to the whole TR or on the first TD only, like so:
<tr onclick="hiliteTR(this)"><td>tada</td><td>tada</td></tr>
<tr><td onclick="hiliteTR(this.parentNode)">tada</td><td>tada</td></tr>

HTH
Ivo
Jul 23 '05 #2
Jon
Ok

Yes it worked perfectly.

But I need it too work on several rows at the sametime

Everytime I click on LAG 1, the row that start's with LAG 1
will be highlighted.

"Ivo" <no@thank.you> skrev i meddelandet
news:40********************@news.wanadoo.nl...
"Jon" typed
Looking for a way to select the fullrow when i click on LAG 3
So it marks all of LAG 3 for July, August, September
If I select LAG 4 it'll select of LAG 4 in the different months

It would very nice if there is a way with Javascript
Follow the link below
http://www.johak.se/schema/index.html


For example:
<script type="text/javascript">
function hiliteTR(el) {
var cel=el.cells;
var c=cel[0].style.background;
for (var i=cel.length;i--;)
cel[i].style.background= (c=='gold') ? 'none' : 'gold';
}
</script>

This function can be called by adding a so-called onclick event handler,
either to the whole TR or on the first TD only, like so:
<tr onclick="hiliteTR(this)"><td>tada</td><td>tada</td></tr>
<tr><td onclick="hiliteTR(this.parentNode)">tada</td><td>tada</td></tr>

HTH
Ivo

Jul 23 '05 #3
Ivo
"Jon" wrote
"Ivo" skrev
"Jon" typed
Looking for a way to select the fullrow when i click on LAG 3
So it marks all of LAG 3 for July, August, September
If I select LAG 4 it'll select of LAG 4 in the different months

It would very nice if there is a way with Javascript
Follow the link below
http://www.johak.se/schema/index.html
<snip script>
Yes it worked perfectly.
But I need it too work on several rows at the sametime


I see. The following function does that (it also sets the background on the
TR deirectly and not on its TD's separately as did the previous function for
no good reason):

function hiliteTR(el) {
var col= (el.style.background=='gold') ? 'none' : 'gold';
var r=0; while(el=el.previousSibling) r++;
var t=document.getElementsByTagName('table');
for(var i=t.length; i--; ) t[i].rows[r].style.background=col;
}

You keep add more tabels with more months to the page and the script will
find them. See it in action at http://4umi.com/test2.htm where I have also
made a beginning with moving some stuff out of the HTML into a stylesheet.
HTH
Ivo
Jul 23 '05 #4
Jon
Thanks

It's works perfectly

Jon
"Ivo" <no@thank.you> skrev i meddelandet
news:40**********************@news.wanadoo.nl...
"Jon" wrote
"Ivo" skrev
"Jon" typed
> Looking for a way to select the fullrow when i click on LAG 3
> So it marks all of LAG 3 for July, August, September
> If I select LAG 4 it'll select of LAG 4 in the different months
>
> It would very nice if there is a way with Javascript
> Follow the link below
> http://www.johak.se/schema/index.html
>
<snip script>

Yes it worked perfectly.
But I need it too work on several rows at the sametime


I see. The following function does that (it also sets the background on

the TR deirectly and not on its TD's separately as did the previous function for no good reason):

function hiliteTR(el) {
var col= (el.style.background=='gold') ? 'none' : 'gold';
var r=0; while(el=el.previousSibling) r++;
var t=document.getElementsByTagName('table');
for(var i=t.length; i--; ) t[i].rows[r].style.background=col;
}

You keep add more tabels with more months to the page and the script will
find them. See it in action at http://4umi.com/test2.htm where I have also
made a beginning with moving some stuff out of the HTML into a stylesheet.
HTH
Ivo

Jul 23 '05 #5

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

Similar topics

1
5232
by: JT | last post by:
I have an input form for which I've created a "matrix" for user input. Basically, the user chooses a radio button and then through javascript, a select box is displayed to define a value for that...
21
5215
by: John Fabiani | last post by:
Hi, I'm a newbie and I'm attempting to learn howto create a select statement. When I use >>> string1='18 Tadlock Place' >>> cursor.execute("SELECT * FROM mytest where address = %s",string1) All...
3
8090
by: Memduh Durmaz | last post by:
Hi, I'm using DB2 UDB 7.2. Also I'm doing some tests on SQL Server 2000 for some statements to use efectively. I didn't find any solution on Sql Server about WITH ... SELECT structure of DB2. ...
4
6415
by: point | last post by:
Hello there... I'm a PHP programmer and starting to learn JS... I have a following problem.... I have 3 select boxes! one is hotel one is destination and one is country... if someone...
10
5586
by: serge | last post by:
Using "SELECT * " is a bad practice even when using a VIEW instead of a table? I have some stored procedures that are identical with the difference of one statement in the WHERE clause. If I...
2
3956
by: Matt | last post by:
Can someone tell me how to do (if possible) a fullrowselect in a datagrid? When you click on a cell it moves the arrow pointer in the gutte to the current cell, but if you click on the gutter it...
0
1037
by: Djimbo | last post by:
How can i select another Fullrow from DataGrid in CurrentCellChanged Handler function?
1
2958
by: serena.delossantos | last post by:
Trying to insert into a history table. Some columns will come from parameters sent to the store procedure. Other columns will be filled with a separate select statement. I've tried storing the...
6
3383
by: Apaxe | last post by:
In the database i have a table with this information: key_id =1 key_desc =43+34+22+12 I want sum the values in key_desc. Something like: SELECT key_desc FROM table But the result of...
0
7213
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
7098
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
5610
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
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
4698
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
3187
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
3176
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1526
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 ...
1
754
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.