Solved

Trying to build web form

Posted on 2014-10-22
9
121 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

743 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

10 Experts available now in Live!

Get 1:1 Help Now