473,498 Members | 1,557 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client side script

Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on
a row to check the checkbox and change the color of that row with performing
a trip back to my web server.

Any suggestions?

Yama
Nov 18 '05 #1
3 1205
Sorry I meant without performing a trip back to the web server.

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on a row to check the checkbox and change the color of that row with performing a trip back to my web server.

Any suggestions?

Yama

Nov 18 '05 #2
you can loop up the parentNode element of the checkbox 'til you hit a
row...something like (not tested)

<input type="checkbox" ...onClick="HighlightRow(this);">

function HighlightRow(checkbox){
if (!checkbox) return;
var parent= null;
for (parent= checkbox.parentNode; parent!= null && parent.TagName !=
'TR';parent= parent.parentNode){}
if (parent != null){
parent.style.background = (checkbox.checked) ? '#ff0000' : '#00ff00';
}
}

Karl

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to click on a row to check the checkbox and change the color of that row with performing a trip back to my web server.

Any suggestions?

Yama

Nov 18 '05 #3
Yes this is pretty much what I have. What I am trying to accomplish is when
the user clicks anywhere withing that row I want the behavior to select the
row as well as check the checkbox.

Any other suggestions?

Yama

"Karl" <none> wrote in message news:Ok**************@TK2MSFTNGP09.phx.gbl...
you can loop up the parentNode element of the checkbox 'til you hit a
row...something like (not tested)

<input type="checkbox" ...onClick="HighlightRow(this);">

function HighlightRow(checkbox){
if (!checkbox) return;
var parent= null;
for (parent= checkbox.parentNode; parent!= null && parent.TagName !=
'TR';parent= parent.parentNode){}
if (parent != null){
parent.style.background = (checkbox.checked) ? '#ff0000' : '#00ff00';
}
}

Karl

"Yama" <yk*****@stbernard.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hi,

I have a datagrid with several columns and a single column containing a
checkbox. The grid has some client-side javascript and style sheet that
allows rollover change of row color.

I would like to add client-side script that would allow the user to
click on
a row to check the checkbox and change the color of that row with

performing
a trip back to my web server.

Any suggestions?

Yama


Nov 18 '05 #4

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

Similar topics

9
4315
by: Kathryn | last post by:
Hiya I have a problem with using some client side and server side scripting together in an ASP. I'm using VBScript. What I'm trying to achieve is this - - Page loads up and some server side...
5
1961
by: tmb | last post by:
Is there a way to use ASP to 'push' a new image to the client every 15 seconds or so? I guess the entire page will have to be 're-sent' to the client but I'm not sure. I'm trying to 'rotate'...
8
3653
by: Mike Fellows | last post by:
Ok, im not sure if this is at all possible and if it is how i go about it is beyond me i have a piece of client side code that requires a piece of data from the server side (an ID number in this...
1
1600
by: Carl Jones via .NET 247 | last post by:
(Type your message here) I'm trying to run a client-side script from a web page. It's a VB script that gets information (computer name, software versions etc )about the computer and writes it to a...
9
4893
by: Harry Smith | last post by:
While reading the documentation on IsStartupScriptRegistered, there is a reference to "client startup script" as "Determines if the client startup script is registered with the Page object." What...
7
1596
by: Mike Rand | last post by:
I am having a really hard time trying to get some client side code hooked up in VS2005, ASP 2.0. The code is in an .inc file (vbscript). The first problem I am encountering is the ASP.NET page...
3
1737
by: jesper_lofgren | last post by:
Hello, I have a problem, i have a event in asp.net codebehind file that updating a datasource. If that update went well i want to refresh my treeview thats on another page. The script works...
1
3122
by: Chris | last post by:
Hi, I have jsut started to learn ASP development and have read many articles regarding which is the best to use regarding JavaScript or VBScript. All of the learning that I have done so far has...
5
13098
by: Ankur | last post by:
Hi Folks, I am new for this group. I want to clarify one thing what's a basic difference between Client Side Java Script and Server Side Java Script. how we can differentiate it. Why we called...
5
2142
by: Simon | last post by:
I heard that we could do that by using AJAX. Could anybody share how to do it? Thanks.
0
7126
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
7005
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
7168
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,...
0
7381
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
4595
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
3096
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
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
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
293
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.