By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,564 Members | 1,070 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,564 IT Pros & Developers. It's quick & easy.

How to collect uncertain number of people information in a form

P: n/a
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
--
Betty
Oct 4 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
"c676228" <be****@community.nospamwrote in message
news:A5**********************************@microsof t.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="VBScript" %>
<% Option Explicit
'*
Const cASP = "census.asp"
'*
Dim intROW
Dim strROW
strROW = Request.Form("rows")
Dim booTBL
booTBL = True
Dim strTBL
strTBL = ""
'*
If Request.Form("show") = "True" Then
Call Show()
ElseIf IsNumeric(strROW) 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("nam" & intROW) & "</td>" & _
" <td>" & Request.Form("ema" & intROW) & "</td>" & _
" <td>" & Request.Form("add" & intROW) & "</td>" & _
" <td>" & Request.Form("tel" & intROW) & "</td>" & _
" <td>" & Request.Form("dob" & intROW) & "</td>" & _
"</tr>"
Next
booTBL = False
End Sub
%>
<html>
<head>
<title>census.htm</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">Name<hr></th>
<th align="left">Amail<hr></th>
<th align="left">Address<hr></th>
<th align="left">Phone<hr></th>
<th align="left">Birthdate<hr></th>
</tr>
<%=strTBL%>
</table>
<% If booTBL Then %>
<input type="hidden" name="rows" value="<%=strROW%>">
<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>
Oct 4 '06 #2

P: n/a
Mckirahan,
That's the perfect start for me to think about it. Thank you so much.
Allow me to ask you one more question, what does Request.Form("") serve for?
Sincerely
--
Betty
"McKirahan" wrote:
"c676228" <be****@community.nospamwrote in message
news:A5**********************************@microsof t.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="VBScript" %>
<% Option Explicit
'*
Const cASP = "census.asp"
'*
Dim intROW
Dim strROW
strROW = Request.Form("rows")
Dim booTBL
booTBL = True
Dim strTBL
strTBL = ""
'*
If Request.Form("show") = "True" Then
Call Show()
ElseIf IsNumeric(strROW) 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("nam" & intROW) & "</td>" & _
" <td>" & Request.Form("ema" & intROW) & "</td>" & _
" <td>" & Request.Form("add" & intROW) & "</td>" & _
" <td>" & Request.Form("tel" & intROW) & "</td>" & _
" <td>" & Request.Form("dob" & intROW) & "</td>" & _
"</tr>"
Next
booTBL = False
End Sub
%>
<html>
<head>
<title>census.htm</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">Name<hr></th>
<th align="left">Amail<hr></th>
<th align="left">Address<hr></th>
<th align="left">Phone<hr></th>
<th align="left">Birthdate<hr></th>
</tr>
<%=strTBL%>
</table>
<% If booTBL Then %>
<input type="hidden" name="rows" value="<%=strROW%>">
<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>
Oct 4 '06 #3

P: n/a
"c676228" <be****@community.nospamwrote in message
news:3B**********************************@microsof t.com...
Mckirahan,
That's the perfect start for me to think about it. Thank you so much.
Allow me to ask you one more question,
what does Request.Form("") serve for?
Request.Form("") returns the contents of the form field named
within the parentheses when the form is posted.

Thus, Request.Form("test_field") returns the contents of
<input type="text" name="test_field" ...>

The form field could be a text or password item, select option(s),
checkbox, radiobutton, or textarea.

For more information, visit these links:

ASP Tutorial
http://www.w3schools.com/asp/

ASP Request Object
http://www.w3schools.com/asp/asp_ref_request.asp
Oct 4 '06 #4

P: n/a
I will suggest you bind your datasource to a GridView Control.
This way, u can view any page by clicking on the page number, by the bottom
of the gridview control. any updates made to the datasource is made once.
If your data is comming from a middle Tier(a user defined class), you may
choose ObjectDataSource as the datasource and bind it to the gridview.
--
Okoronkwo Chinedu
MCAD
"c676228" wrote:
Mckirahan,
That's the perfect start for me to think about it. Thank you so much.
Allow me to ask you one more question, what does Request.Form("") serve for?
Sincerely
--
Betty
"McKirahan" wrote:
"c676228" <be****@community.nospamwrote in message
news:A5**********************************@microsof t.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="VBScript" %>
<% Option Explicit
'*
Const cASP = "census.asp"
'*
Dim intROW
Dim strROW
strROW = Request.Form("rows")
Dim booTBL
booTBL = True
Dim strTBL
strTBL = ""
'*
If Request.Form("show") = "True" Then
Call Show()
ElseIf IsNumeric(strROW) 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("nam" & intROW) & "</td>" & _
" <td>" & Request.Form("ema" & intROW) & "</td>" & _
" <td>" & Request.Form("add" & intROW) & "</td>" & _
" <td>" & Request.Form("tel" & intROW) & "</td>" & _
" <td>" & Request.Form("dob" & intROW) & "</td>" & _
"</tr>"
Next
booTBL = False
End Sub
%>
<html>
<head>
<title>census.htm</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">Name<hr></th>
<th align="left">Amail<hr></th>
<th align="left">Address<hr></th>
<th align="left">Phone<hr></th>
<th align="left">Birthdate<hr></th>
</tr>
<%=strTBL%>
</table>
<% If booTBL Then %>
<input type="hidden" name="rows" value="<%=strROW%>">
<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>

Oct 7 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.