asp form progression

W

Wayne-I-M

Hi

Not really sure if I'm on the right lines so, if not please tell me.

I have a form on an asp page
One of the questions is How Many Rooms Do You Want ?
User can select 1,2,3,4 or 5

Question rather than having 5 pages with
page 1 with 1 room details
page 2 with 2 room details
etc

Can I have just one page and hide various "bits"
So if a user select I want 3 rooms
on the next page room 4 and 5 details are hidden

Dead easy in access but asp ?? (just learning)

This is old page I have (not linked to or used any more)

http://www.folgarida.co.uk/page_booking2.asp

Any examples or web pages with step by step would be really good

Many thanks
 
S

Stefan B Rusynko

Yes you can on a multipage form
- in the 2nd page wrap the forms fields for 4 & 5 with VBscript to only show if there is a value
(say the field on form 1 is NoRooms with values of 1 thru 5)
<% IF Request.Form("NoRooms") =4 THEN %>
.... 4 room questions
<%END IF %>
<% IF Request.Form("NoRooms") =5 THEN %>
.... 4 room questions
<%END IF %>



| Hi
|
| Not really sure if I'm on the right lines so, if not please tell me.
|
| I have a form on an asp page
| One of the questions is How Many Rooms Do You Want ?
| User can select 1,2,3,4 or 5
|
| Question rather than having 5 pages with
| page 1 with 1 room details
| page 2 with 2 room details
| etc
|
| Can I have just one page and hide various "bits"
| So if a user select I want 3 rooms
| on the next page room 4 and 5 details are hidden
|
| Dead easy in access but asp ?? (just learning)
|
| This is old page I have (not linked to or used any more)
|
| http://www.folgarida.co.uk/page_booking2.asp
|
| Any examples or web pages with step by step would be really good
|
| Many thanks
| --
| Wayne
| Manchester, England.
|
 
W

Wayne-I-M

Thanks for that Stefan

I have not got my head around this one. soory

I have these page
http://www.folgarida.co.uk/test.asp
and
http://www.folgarida.co.uk/test2.asp

I have got the (just to see it's working) the number to show up in the white
text box at the top of the form on test2

but I can work out how to hide the other rooms
as you can see I have put your code in - but obviously doing something wrong
as it does nothing

Any ideas would helpful
 
W

Wayne-I-M

Hi Ronx

Thanks for that but (prob wrong about this) but the code on your form is a
submit ??

I am try to work your codes into this
http://www.folgarida.co.uk/Booking_Page_Advance_5.asp
which should then reduce the number of available rooms on page 6 (the next
form)

and I keep getting an error
(I have taken the code of page 6 just so you can see)

any ideas

Thanks again

--
Wayne
Manchester, England.
 
R

Ronx

The page I produced was based on yours, and submits to itself. Its
purpose is to demonstrate how the display of multiple rooms can be
controlled according to the number entered in the number of rooms
textbox at the bottom.

Your page 6 appears to be working - but I don't understand why the
number of rooms has to be chosen twice on page 5. Only the second select
seems to be relevant.
--
Ron Symonds - Microsoft MVP (Expression)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 
R

Ronx

Confuses me, too.

Change this:
<%
Dim noRooms
Dim temp
temp = request.form("Text1") & ""
if not isNumeric(temp) then
noRooms = 1
else
noRooms = cInt(temp)
end if
if noRooms<1 then
noRooms = 3
end if
%>

To

<%
Dim noRooms
Dim temp
temp = request.form("Text1") & ""
if not isNumeric(temp) then
noRooms = 1
else
noRooms = cInt(temp)
end if
if noRooms<1 then
noRooms = 3
end if
response.write("formfield=" & temp & " noRooms=" & noRooms)
%>

This will give the values picked up from the Text1 field, and the value
given to variable noRooms - these *should* be the same.

There is an extra <body> and </body> tag at the end of the page - it
won't affect the results, and it's on my page as well, but shouldn't be
there.
--
Ron Symonds - Microsoft MVP (Expression)
Reply only to group - emails will be deleted unread.

http://www.rxs-enterprises.org/fp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top