Solved

Html table formating in ASP  HELP!

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP server side get value 15 50
Html fieldset fix its height and width 4 59
Two decimal 5 43
calculate days away 11 61
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

739 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