Solved

Trying to build web form

Posted on 2014-10-22
9
142 Views
Last Modified: 2014-10-24
I am trying to build a form in ASP.NET(VB code) that has 0-9 in the header of the columns and try to create some kind of row header from 0-9. (Please see the attached pic of what I am trying to create)And when a user clicks into one of the boxes it would pass me the values that I have in the grid already.  Can someone please help me with this.
C--Users-VCISJMK-Desktop-Matrix.jpg
0
Comment
Question by:jknj72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 22

Expert Comment

by:plusone3055
ID: 40396981
This is fairly simple and can be done in 3 steps
1. create a HTML table and name the columns appropriately
2. make your values txt values or labels
3. do a Javascript onclick  to pass the variable assigned to that txt/lbl value

When you say  "pass me the values "  Please elaborate.. do you want a popup message displaying the value ?? What exactly are you doing with the values...
0
 

Author Comment

by:jknj72
ID: 40397057
I am not real good with html thats why Im trying to get some help on this. When I say pass the values I mean that I need to know which cell is being clicked so I would need to know which column, row was clicked. Thats why I put the values in the cells of what I would want to see. If I could somehow use a grid I know I can capture what cell is being clicked but I just dont know how to set up the grid how I need it to look. Any thoughts?
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40397398
okay I can help whip something up for you.. I have a meeting this afternoon but I can write something up this evening and post it here
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jknj72
ID: 40397710
Thanks alot plusone, I would really appreciate your help
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40399562
i didn't forget about you.. give me about 30-40 min and I'll have the shell of this built
0
 
LVL 22

Accepted Solution

by:
plusone3055 earned 500 total points
ID: 40399732
Here you go :)

just click on the table column to pass the value in a popup Picture
<html>
<head>
    <title>Experts Exchange HTML Form </title>
	</head>


<body>
    <table align="center" id="tblExample" border="1" style="cursor: pointer;">
        <tr>
            <td bgcolor="yellow">
                0
            </td>
             <td bgcolor="yellow">
                1
            </td>
             <td bgcolor="yellow">
              2
            </td>
             <td bgcolor="yellow">
              3
            </td>
        </tr>
        <tr>
           <td bgcolor="yellow">
                1
            </td>
            <td>
                get the value 
            </td>
            <td>
              another value 
            </td>
            <td>
              numbers 12345 
            </td>
        </tr>
        <tr>
          <td bgcolor="yellow">
             2
            </td>
            <td>
                Hooray	
            </td>
            <td>
           exactly what you asked for
            </td>
            <td>
              you can follow this code 
            </td>
        </tr>
        <tr>
            <td bgcolor="yellow">
               3
            </td>
            <td>
             and create more 
            </td>
            <td>
               as many as you need 
            </td>
            <td>
            have a nice day :) 
            </td>
        </tr>
    </table>
	
	<script language="javascript">
 
        var tbl = document.getElementById("tblExample");
        if (tbl != null) {
            for (var i = 0; i < tbl.rows.length; i++) {
                for (var j = 0; j < tbl.rows[i].cells.length; j++)
                    tbl.rows[i].cells[j].onclick = function () { getval(this); };
            }
        }
 
        function getval(cel) {
            alert(cel.innerHTML);
        }
    </script>
    <br />
    
</body>
</html>

Open in new window

0
 

Author Comment

by:jknj72
ID: 40401937
this looks like exactly what I need.  Thanks plusone this helps me out big time....
0
 

Author Closing Comment

by:jknj72
ID: 40401938
great job bud...
0
 
LVL 22

Expert Comment

by:plusone3055
ID: 40402052
your welcome.. sorry it took so long
0

Featured Post

Learn by Doing. Anytime. Anywhere.

Do you like to learn by doing?
Our labs and exercises give you the chance to do just that: Learn by performing actions on real environments.

Hands-on, scenario-based labs give you experience on real environments provided by us so you don't have to worry about breaking anything.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question