Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing a variable into new page form

Status
Not open for further replies.

mlawson

Technical User
Jun 12, 2001
197
GB
I (would dearly like to!)have a form that requests a value for the number of participants. This is then passed onto a subsequent form that will have fields for name, position, address, email in a repeating field to the value of the first form. Any clues? I think I can manage the multiple insert of the form, it's the passing of the information between pages that's foxing me.

Grateful for any wise words!

M
 
Well if I am right then u want to take a N number of users names in page2 where "N" will be defined at page 1.. Am i right...

If so then where is the problem to getting repetative fields?

Suppose user enters value of "N" in page 1 (text box name=txtUsers).. then submit the information to page 2.. In page 2 U will hav ethe following code:

<%for(i= 0 to request.form(&quot;txtUsers&quot;)-1)%>
User Name : <INPUT type=text id=txtName >
<% Next %>

The above code will create space for entering &quot;N&quot; user Names..

After entering and when u submit the data for inserting then U need to go through the array of elements ..as u can see they will have same name..

I know i might not be clear in expressing .. i have just given u hint ... from here u can pick up ... still confused ? then let me know...

srinu...


 
Thanks, I think I may be able to get this together from your code. I may have created too big an issue for the repeating form field, as you suggested, it could be a bit fiddly trying to create unique identifiers for the text field names.
I shall, however, battle on and see how far I get before I have to bother you again.

Thanks

M
 
This is how I do it:

Response.Redirect &quot; g_custid

You set g_custid to the number of participants & then on the next page,

g_custid = trim(Request.QueryString(&quot;userid&quot;))

Then g_custid would equal the number of participants on the next page. If you are passing only one variable, I found this to work extremely well.
 
Thanks for your help, something else to try. I'll report back once (if ) I get it to work!

M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top