Solved

Html table formating in ASP  HELP!

Posted on 2000-03-04
5
205 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
[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 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

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 informatio…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

617 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