Solved

Trying to build web form

Posted on 2014-10-22
9
135 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

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:…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

772 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