Current location: Hot Scripts Forums » Programming Languages » ASP » ASP Form, using FOR Loop


ASP Form, using FOR Loop

Reply
  #1 (permalink)  
Old 06-21-06, 03:01 AM
dpeters dpeters is offline
Newbie Coder
 
Join Date: Jun 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
ASP Form, using FOR Loop

1. Create a form with four textbox. 1st text box is for the name, 2nd is for the telephone number, 3rd and 4th will be the start and end of a FOR Loop.

2. After the form has been submitted, it should display the name and telephone number ‘x’ number of times where x is dependent on the numbers entered in the 3rd and 4th box.

I have this code so far..

Code:
<form action="submit.asp" method="post">
<div style="width: 300px; text-align: right;">
<p>First name: <input name="firstname"></p>
<p>Last name: <input name="lastname"></p>
<p>Telephone: <input name="phone"></p>
<p>Age: <input name="age"></p>
<p>Favourite number: <input name="favnumber"></p>
<p><input type="submit"></p>
</div>
</form>
And on the submitted page..

Code:
Well, <b><%=Request.Form("firstname")%>&nbsp;<%=Request.Form("lastname")%></b>, I have some information to share with you..
<br />
Your telephone number is <b><%=Request.Form("phone")%></b>.
<br />
Your age is <b><%=Request.Form("age")%></b>.
<br />
Your favourite number is <b><%=Request.Form("favnumber")%></b>.
If anyone could help me put a For Loop in here that works how the 1. and 2. ask it would be a great help!
Reply With Quote
  #2 (permalink)  
Old 06-21-06, 04:34 AM
dpeters dpeters is offline
Newbie Coder
 
Join Date: Jun 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
This is what I have been playing with as a For Loop..

Code:
For x = 0 To Request.Form("age")
	xx = xx + 1
	'Request.Form("age") = xx
	Request.Form("firstname")
Next
Reply With Quote
  #3 (permalink)  
Old 06-21-06, 05:30 AM
dpeters dpeters is offline
Newbie Coder
 
Join Date: Jun 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Code:
<% 
	Dim Form("age"), y, x
	Dim xx
	Request.Form("firstname")
%>

<%
	For y = Request.Form("age") To Request.Form("favnumber")
		xx = xx + 1
		Request.Form("firstname")
	Next
%>
I dont think im even close..?
Reply With Quote
  #4 (permalink)  
Old 06-21-06, 07:23 AM
dpeters dpeters is offline
Newbie Coder
 
Join Date: Jun 2006
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Could this be close? Can anyone help?

Code:
	Dim x (99), i, y
	
	For y = Request.Form("age") To Request.Form("favnumber")
		y = y + 1
		Request.Form("firstname")
	Next
	
	Request.Form("firstname")
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP Form Script needed mringer ASP 2 04-21-10 04:02 AM
ASP help for validation of HTML form with javascript dhanashree ASP 2 03-22-06 01:28 PM
Selecting image to display via asp form Anessa ASP 3 08-25-05 08:32 AM
ASP upload prob minority ASP 1 06-27-05 08:35 AM
E-Mail from ASP form to MS Exchange rschrab ASP 0 04-20-04 04:41 PM


All times are GMT -5. The time now is 03:48 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.