This is a discussion on "Passing form variable between pages" within the Classic ASP section. This forum, and the thread "Passing form variable between pages are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Passing form variable between pages
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Passing form variable between pages
Iv’e been using rob's functions for passing variables between pages.
I am not much of a ASP man, so maybe the following question is a stupid one, but I still gonna try. I have a form with some select fields. The labels and the values are not the same on these select fields. For example: Select1 has 5 options Text1 value = 10.00 Text2 value = 20.00 Text3 value = 30.00 Text4 value = 40.00 Text5 value = 50.00 When submitting the form I want to get both the text as the values on the other page. Can this be done. I would apreciate any help. |
|
|
|
|||
|
So you want both the displayed text and the value from the selected item on the next page?
If so you'll want to modify the values to include the text, then separate it back out on the second page.
|
|
|||
|
Tnx for the quick reply Catalist.. but no succes yet
I get nothing on the other page. Maybe i explained wrong.. i want to split the label and the value from each other on the next page This is my code on page 1 <form name="form1" method="post" action="form2.asp"> <select name="something"> <option value="Text1|10.00">Text1</option> <option value="Text2|20.00">Text2</option> <option value="Text3|30.00">Text3</option> </select> and yours on page 2 <% s = request.form("something") text = left(s,instr(s,"|")-1) value = right(s,len(s)-instr(s,"|")) %> |
|
|||
|
i take it your are actually writing out the values of text and value?
Response.Write text Response.Write value |
|
|||
|
yes
|
|
||||
|
This is actually what is required on page 2:-
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
yep, both examples work, only now i stumbled opon the next problem.
On the first page i do a calculation of prices (the value part)before submitting them to the next page, but that doesnt work any more because we put the text in there aswell. And that's where i wanted to split up text and value. i will try to tell exactly what and where i need this for. I have a website where people can rent a gameserver. I made a little form with the following formfields A select/list box called "game" with names of the game servers, the prices are the values of this select box. A Select/list box called "Privpubl" where there are 2 choices, private server or public server. The value of private server = 0.00 and public = 30.00. A select/list box called "players" where the text = number of player (16,18, etc) and the values are 0.00,3.00,6.00, etc. And a textfield called "result" When people make selections from which server they want the form adds the values and put them into the result field. When they made there final selection they can submit the form. On the next page i want to split the values and the text into different form fields. After that i want to submit all that data into a SQL database (that's no problem btw) So i hope you see my problem, i cannot put text|value in the value part of a select/list boxor else my calculating gets scr*wed up. |
|
||||
|
Can you post a txt version of both pages here? (or link to a txt version of them)
Cheers,
__________________
Rob - SEO Specialist Owner & Founder of Webforumz.com I am currently unavailable for private work
Last Blog Entry: Creative Labs threaten developer over home made drivers.... (Apr 1st, 2008)
|
|
|||
|
Ok here they come
Page 1 is http://www.ultimateservers.nl/test/form1.txt Page 2 is http://www.ultimateservers.nl/test/form2.txt They are a bit big because i made a txt version of the complete pages. If you go to my site www.ultimateservers.nl and click on game servers in the left colum you see the calculation form Tnx for al your help.. |
![]() |
| Tags |
| passing, form, variable, between, pages |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| form variable within an iframe component of a form | kissfreaque | JavaScript Forum | 5 | Feb 29th, 2008 11:57 |
| passing data accross multiple pages | nate2099 | PHP Forum | 2 | Jul 8th, 2007 15:26 |
| Variable passing | VanderBOOM | JavaScript Forum | 20 | Nov 2nd, 2006 21:39 |
| Passing a Variable to ASP | Smog36 | Flash & Multimedia Forum | 1 | Sep 13th, 2006 14:05 |
| [SOLVED] Passing my variable, help please | Anonymous User | PHP Forum | 0 | Feb 12th, 2005 13:37 |