"c676228" <be****@communi ty.nospamwrote in message
news:A5******** *************** ***********@mic rosoft.com...
Hi everyone,
I need to write a insruance program which needs to collect multiple people
information,
The information for each person includes name, email, address, phone, dob
etc.
The DOB data will be used for calculate premium for each person. and then
display total premium quote to the user
I had never done that before and not sure, in asp technology what is the
easiest way to do.
Let's say the user want to enroll 30 people but I cannot display 30 grid
on
one asp page, and have to display 15 grid on the first page and then next
15
on the next page. What I should do in order to store all the information
about the 30 people in the memory and insert into database at a once.
Thank you
Why not show a grid for as many people as needed?
Will this get you started? Watch for word-wrap.
It's 3 pages in one: first it asks how many rows you want;
then it allows entry or that number of rows; then it displays
what was entered in those rows.
Just add field validation, database access, and a better UI.
<%@ Language="VBScr ipt" %>
<% Option Explicit
'*
Const cASP = "census.asp "
'*
Dim intROW
Dim strROW
strROW = Request.Form("r ows")
Dim booTBL
booTBL = True
Dim strTBL
strTBL = ""
'*
If Request.Form("s how") = "True" Then
Call Show()
ElseIf IsNumeric(strRO W) Then
Call Rows()
End If
Sub Rows()
For intROW = 1 To Cint(strROW)
strTBL = strTBL & _
"<tr>" & _
" <td>" & intROW & ".</td>" & _
" <td><input type='text' name='nam" & intROW & "' size='20'
maxlength='30' class='text'></td>" & _
" <td><input type='text' name='ema" & intROW & "' size='20'
maxlength='50' class='text'></td>" & _
" <td><input type='text' name='add" & intROW & "' size='30'
maxlength='50' class='text'></td>" & _
" <td><input type='text' name='tel" & intROW & "' size='15'
maxlength='20' class='text'></td>" & _
" <td><input type='text' name='dob" & intROW & "' size='10'
maxlength='10' class='text'></td>" & _
"</tr>"
Next
End Sub
Sub Show()
For intROW = 1 To Cint(strROW)
Request.Form("" )
strTBL = strTBL & _
"<tr>" & _
" <td>" & intROW & ".</td>" & _
" <td>" & Request.Form("n am" & intROW) & "</td>" & _
" <td>" & Request.Form("e ma" & intROW) & "</td>" & _
" <td>" & Request.Form("a dd" & intROW) & "</td>" & _
" <td>" & Request.Form("t el" & intROW) & "</td>" & _
" <td>" & Request.Form("d ob" & intROW) & "</td>" & _
"</tr>"
Next
booTBL = False
End Sub
%>
<html>
<head>
<title>census.h tm</title>
<style type="text/css">
body { font-family:Arial; font-size:9pt }
td { font-family:Arial; font-size:8pt }
th { font-family:Arial; font-size:8pt; font-weight:bold }
..text { font-family:Arial; font-size:8pt }
</style>
</head>
<body>
<center>
<form action="<%=cASP %>" method="post">
<% If strTBL <"" Then %>
<h4>Enter Census Data</h4>
<table border="0" cellpadding="0" cellspacing="2" width="700">
<tr>
<th align="left">No .<hr></th>
<th align="left">Na me<hr></th>
<th align="left">Am ail<hr></th>
<th align="left">Ad dress<hr></th>
<th align="left">Ph one<hr></th>
<th align="left">Bi rthdate<hr></th>
</tr>
<%=strTBL%>
</table>
<% If booTBL Then %>
<input type="hidden" name="rows" value="<%=strRO W%>">
<input type="hidden" name="show" value="True">
<input type="submit" value="Submit">
<% End If %>
<% Else %>
<input type="hidden" name="show" value="False">
<input type="text" name="rows" size="2" maxlength="2" value="1">
<input type="submit" value="Submit">
<% End If %>
</form>
</center>
</body>
</html>