troubleshooting Question

Javascript: detecting table cell clicks -- first click versus second click

Avatar of Tom Knowlton
Tom KnowltonFlag for United States of America asked on
12 Comments1 Solution353 ViewsLast Modified:
Dear Expert:

Can you supply complete functionioning ASP source code that does the following:

1)  Creates a 2 x 2 HTML table.  Each cell has a JavaScript OnButtonClick event that passes in the row and column of the cell that was clicked.

2)  Captures row and column clicked for the first cell clicked and the second cell clicked (total of 4 variables)

3)  If second click, compares row (first click) to row (second click) and says if they are the same or different.  Same thing with column (first click) column (second click).

Here's the sequence of events:

1)  Page loads
2)  2 x 2 table is displayed
3)  User clicks cell in first column first row
(internally the assignment is made:)

firstClickRow = 1
firstClickColumn = 1

4)  User clicks cell in second column second row
(internally the assignment is made:)

secondClickRow = 2
secondClickColumn = 2

5)  firstClickRow = secondClickRow?   FALSE

6)  firstClickColumn = secondClickColumn?   FALSE

Many thanks,

Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 12 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 12 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros