Solved

Html table formating in ASP  HELP!

Posted on 2000-03-04
5
201 Views
Last Modified: 2012-06-27
My first project in ASP and definately in the dark. Designing a site for our insurance agency. Wanting to do a small amount of basic rating there. From the first page "numberof.asp" we will use 2 combo boxes "cboDrivers" and "cboVehicles" to collect the quantity of each. Upon submit we would like the receiving page "info.asp" to show sets of form question fields for each number of drivers and vehicles choosen from the first page. I am no sure of the difficulty of all of this so if more points are worthy just LMK.
0
Comment
Question by:colonelmustard
5 Comments
 
LVL 6

Expert Comment

by:Marine
ID: 2583205
in numberof.asp page you can do this.
<FORM action="info.asp" method="post">
<SELECT id=select1 name="cboDrivers">
<option>1</option>
<option>2</option>
</select>
<SELECT id=select1 name="cboVehicles">
<option>1</option>
<option>2</option>
</select>
<input type=submit name="Send Info">
</FORM>
on the info.asp page
request the sended values
<%
drivers= request.form("cboDrivers")
vehicles = request.form("cboVehicles")
%>

I don't know if thats what you wanted though.
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 2583606
Continuing from Marine...

Once ou have drivers and vehicles, you can do this:

<%
For CurDrive = 1 to Drivers
  Response.write "Driver " & CurDriver
    ' Rest of fields...
Next

For CurVehicle = 1 to Vehicles
    Response.write "Vehicle " & CurDriver
    ' Rest of fields...
Next
%>
0
 
LVL 27

Expert Comment

by:BigRat
ID: 2583800
Colonel Mustard of Cluedo fame?

I'm sure there must be more than that on the first page. But Marine's answer is perfectly correct.
0
 
LVL 3

Accepted Solution

by:
rmullins earned 100 total points
ID: 2639130
I have modified Maries post and added a bunch of info to help you see a bit more.
I also over-commented this so you can understand it better.

Try this:
---------------- BEGIN NumberOf.asp ---------------
<HTML><BODY>
<FORM action="info.asp" method="post">
<%'Select number of drivers%>
  Number of Drivers
    <SELECT name="cboDrivers">
      <option>1</option>
      <option>2</option>
    </select>
<%'New line and a blank line%>
  <br><br>
<%'Select number of vehicles%>
  Number of Vehicles
    <SELECT name="cboVehicles">
      <option>1</option>
      <option>2</option>
    </SELECT>
<%'New line and a blank line%>
  <br><br>
<%'Display button causing info to be sent to info.asp%>
  <INPUT type="submit" name="Continue">
</FORM>
</BODY></HTML>
---------------- END NumberOf.asp ---------------

---------------- BEGIN Info.asp ---------------
<%@ Language="VBScript"%>
<%OPTION EXPLICIT%>
<%
'Declare Variables
    Dim intDrivers
    Dim intVehicles
    Dim i
'Get number of drivers and vehicles
      intDrivers = CInt(Request.Form("cboDrivers"))
      intVehicles = CInt(Request.Form("cboVehicles"))
%>
<HTML><BODY>
You selected <%=intDrivers%> driver and <%=intVehicles%> vehicles.<br><br>
<FORM action="step3.asp" method="post">
<hr>
<b><u>Drivers:</b></u><br>
<%'Display the driver info boxes%>
 <TABLE align="center">
      <%For i = 1 to intDrivers%>
            <tr><td colspan="2"><b><u>Driver #<%=i%>:</u></b></td></tr>
            <tr><td>Name:</td>
                  <td><INPUT type="text" name="txtName"></td></tr>
            <tr><td>Age:</td>
                  <td><INPUT type="text" name="txtAge"></td></tr>
            <tr><td colspan="2">&nbsp;</td></tr>
      <%Next%>
 </TABLE><br><hr>
<b><u>Vehicles:</b></u><br>
<%'Display the vehicle info boxes%>
 <TABLE align="center">
      <%For i = 1 to intVehicles%>
            <tr><td colspan="2"><b><u>Vehicle #<%=i%>:</u></b></td></tr>
            <tr><td>Year:</td>
                  <td><INPUT type="text" name="txtYear"></td></tr>
            <tr><td>Make:</td>
                  <td><INPUT type="text" name="txtMake"></td></tr>
            <tr><td>Model:</td>
                  <td><INPUT type="text" name="txtModel"></td></tr>
            <tr><td colspan="2">&nbsp;</td></tr>
      <%Next%>
 </TABLE><hr>
</FORM>
</BODY></HTML>
---------------- END NumberOf.asp ---------------

That completely answers your question and ought to get you going. Good luck.
-- Rob --
0
 
LVL 3

Expert Comment

by:rmullins
ID: 2639133
Ick, sorry about the formatting being so bad. I didn't 'respace' info.asp in InterDev (tested it) before I dropped it in here.

Pull it into your editor and you can quickly reformat it to enhance readability.

-- Rob --
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

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

13 Experts available now in Live!

Get 1:1 Help Now