473,395 Members | 1,948 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

A simple grid rows / columns.

263 100+
Hi all.

I need your help.

I realize this script and I do not know where to begin:

1) A simple grid rows / columns.
2) The first column contain an input type = "checkbox"
3) When select the input type, the line should change color than the other rows, and you should open a popup window.

For points 1, 2 you are OK.
Point 3 is the difficulty.

Suggestions?
Examples?

Kind regards
Viki
Feb 8 '10 #1
6 2884
This should get you going.

Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function colorThisRow(row) {
  3.     if (document.getElementById("check" + row).checked) {
  4.         document.getElementById("row" + row).style.backgroundColor = "yellow";
  5.     } else {
  6.         document.getElementById("row" + row).style.backgroundColor = "white";
  7.     }
  8. }
  9. </script>
  10. <table border>
  11.     <tr id="row1">
  12.         <td>
  13.             <input type="checkbox" id="check1" onClick="colorThisRow(1)" />Click Me
  14.         </td>
  15.         <td>
  16.             Some stuff here1
  17.         </td>
  18.     </tr>
  19.     <tr id="row2">
  20.         <td>
  21.             <input type="checkbox" id="check2" onClick="colorThisRow(2)" />Click Me
  22.         </td>
  23.         <td>
  24.             Some stuff here2
  25.         </td>
  26.     </tr>
  27. </table>
  28.  
  29.  
  30.  
Feb 8 '10 #2
viki1967
263 100+
Thanks x your answer.
This code work but open popup window when select the checkbox?
Feb 9 '10 #3
Specifically, what type of popup? Do you mean like a new window?
Feb 9 '10 #4
viki1967
263 100+
Ok, yes new window popup when I select the checkbox.
thanks
Feb 9 '10 #5
A very easy way to do this would be to append this code to your checkbox function:

Expand|Select|Wrap|Line Numbers
  1. w=window.open();
  2. w.document.open();
  3. w.document.write("<h1>This is my popup!</h1><p>Put something meaningful here...</p>");
  4. w.document.close();
  5.  
PRO: Very flexible, widely supported
CON: Many browsers open this in a new tab and sometimes don't even give the tab focus!

I do assume that the simple alert(text), confirm(text) and prompt(text,value) methods are too simplistic for your needs?
Feb 9 '10 #6
viki1967
263 100+
Ok, thanks x your help!
Feb 9 '10 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Will | last post by:
I've got a simple form that collects data from a user and I want to display that data in a sortable grid or table. The nature of this data is rather temporary, so there's no need to persist it to a...
0
by: Tal Sharfi | last post by:
Hi everyone I recently had the need for StringGrid object same as the one that Delphi has. An object that helps show lists of other objects in a simple grid. I searched the news groups and...
4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
2
by: Kenneth | last post by:
Hi, I want to make sure I got the easiest way on how to bind a grid's datasource to a datatable. I've made an in-memory datatable Dim dtTotal As DataTable Dim drow As DataRow dtTotal = New...
6
by: Tejpal Garhwal | last post by:
I have datagrid filled with some data rows. At the run time i want know how many total rows are there in the data grid ? Any idea ? Any Suggestions ? Thanks in advance Tej
117
by: phil-news-nospam | last post by:
Is there really any advantage to using DIV elements with float style properies, vs. the old method of TABLE and TR and TD? I'm finding that by using DIV, it still involves the same number of...
0
by: Gian Paolo | last post by:
this is something really i can't find a reason. I have a form with a tabcontrol with tree pages, in the second page there is a Data GRid View. Plus i have a class. When i open the form i...
3
by: veenna | last post by:
How can i refresh datagrid in vb.net. I want to display color in one cell in grid but when it loads first time it is working here is my code Public Class Dialog_Colorazione Const YEAR_START...
0
by: patogenic | last post by:
I want to use the grid for record insertion. Everything works fine except after saving the new record; all controls for record insertion are still visible besides the "Add New" button. I think...
2
by: Claudia Fong | last post by:
Hi, How can I create a grid of 20 Columns by 30 Rows using asp.net? Cheers! Claudi *** Sent via Developersdex http://www.developersdex.com ***
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...
0
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
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,...

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.