Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Html table formating in ASP  HELP!

Posted on 2000-03-04
5
Medium Priority
?
207 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 400 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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/…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

715 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