Solved

Trying to build web form

Posted on 2014-10-22
9
129 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
  • 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
 

Author Comment

by:jknj72
ID: 40397710
Thanks alot plusone, I would really appreciate your help
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Calling web service and its methods dynamically 2 42
Vb. Net application freezes 9 30
Output Caching in IIS 2 9
ASP.NET MVC 2 0
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now