If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Drop Down menu

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-02, 11:30
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
Drop Down menu - PLEASE HELP ME

1) I have created a web form with drop down menu's. After the web form is saved to an microsoft access database and you leave the page or even refresh the page it also resets the drop down menu. Is there a way to stop that?

John316

Last edited by John316; 11-02-02 at 00:00.
Reply With Quote
  #2 (permalink)  
Old 10-23-02, 06:19
pickledAvenger pickledAvenger is offline
Registered User
 
Join Date: Apr 2002
Location: England
Posts: 21
Re: Drop Down menu

As far as I know you can't force the drop down menu open, although you can force it to be displayed as a list by defining a size greater than 1.

e.g
<select name="menu" size="2">

this would make it a scrollable box where size defines the number of items shown before having to scroll.

Dan
Reply With Quote
  #3 (permalink)  
Old 10-23-02, 11:37
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
Re: Drop Down menu

Dan,

I have now changed it to: <select name="menu" size="5" multiple> but still after the web form is saved to an microsoft access database and you leave the page or even refresh the page it still resets the drop down menu. Do you have any other idea's?

John316



Quote:
Originally posted by pickledAvenger
As far as I know you can't force the drop down menu open, although you can force it to be displayed as a list by defining a size greater than 1.

e.g
<select name="menu" size="2">

this would make it a scrollable box where size defines the number of items shown before having to scroll.

Dan
Reply With Quote
  #4 (permalink)  
Old 10-24-02, 09:04
pickledAvenger pickledAvenger is offline
Registered User
 
Join Date: Apr 2002
Location: England
Posts: 21
What is your page written in HTML or are you using server side scripting(ASP, PHP etc)?
Reply With Quote
  #5 (permalink)  
Old 10-24-02, 22:23
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
I wrote this in....

I wrote this in .asp

John316

Quote:
Originally posted by pickledAvenger
What is your page written in HTML or are you using server side scripting(ASP, PHP etc)?
Reply With Quote
  #6 (permalink)  
Old 10-25-02, 04:49
pickledAvenger pickledAvenger is offline
Registered User
 
Join Date: Apr 2002
Location: England
Posts: 21
Re: I wrote this in....

I'm asuming that you want the selected values to stay selected after the page has been submited.

You will need to pass the entered form/info back to this page, either as a query string or a form.

Use Response.Write to display your select box, this way you can control what will be written.

So you will have somthing like:

dim selected
selected = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans1" then
Response.Write (" selected")
end if

Response.Write (">ans1</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)

This will make the selected option chosen after submit provided the form was posted to this page (if you have been redirected to this page after submitting to another you will need to pass this info on to the page with the drop down menu). This will only hold the info when the page is refreshed after the info has been submited once.

Hope this is kind of what you're after

Dan
Reply With Quote
  #7 (permalink)  
Old 10-27-02, 19:00
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
Re: I wrote this in....

Dan,

NO matter how I try your code it does not work, my code is below:

<%
dim Order
Order = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans1" then
Response.Write ("Order")
end if

Response.Write (">ans1</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)
%>

<%
dim Order
Order = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans2" then
Response.Write ("Order")
end if

Response.Write (">ans2</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)
%>

<%
dim Order
Order = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans3" then
Response.Write ("Order")
end if

Response.Write (">ans3</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)
%>

<%
dim Order
Order = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans4" then
Response.Write ("Order")
end if

Response.Write (">ans4</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)
%>


John316

Quote:
Originally posted by pickledAvenger
I'm asuming that you want the selected values to stay selected after the page has been submited.

You will need to pass the entered form/info back to this page, either as a query string or a form.

Use Response.Write to display your select box, this way you can control what will be written.

So you will have somthing like:

dim selected
selected = Request("menu")

Response.Write ("<select name=""menu"" size=""2"">" & VbCr & "<option")

if selected = "ans1" then
Response.Write (" selected")
end if

Response.Write (">ans1</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)

This will make the selected option chosen after submit provided the form was posted to this page (if you have been redirected to this page after submitting to another you will need to pass this info on to the page with the drop down menu). This will only hold the info when the page is refreshed after the info has been submited once.

Hope this is kind of what you're after

Dan

Last edited by John316; 10-28-02 at 13:52.
Reply With Quote
  #8 (permalink)  
Old 10-29-02, 03:57
pickledAvenger pickledAvenger is offline
Registered User
 
Join Date: Apr 2002
Location: England
Posts: 21
You have changed the name of the variable which you are loading the result into (= Request). This is fine, but you will also need to change the varaible name in the IF statement, so for your code all the if statements would need to read 'IF Order = "ans1" then' etc.

If you want send me the pages and I'll take a look.

Dan
Reply With Quote
  #9 (permalink)  
Old 10-29-02, 11:28
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
well pickledAvenger

Dan,

Below I am including my web page information. the only thing that ?I have so far is the drop down menu. I have 9 items in my drop down menu called DropdownItem1 - DropdownItem9. so here is my code:

<form name="form1" method="post" action="update.asp">

<select name=DropdownMenu etc size="4" multiple>
<option value="DropdownItem1">DropdownItem1</option>
<option value="DropdownItem2">DropdownItem2</option>
<option value="DropdownItem3">DropdownItem3</option>
<option value="DropdownItem4">DropdownItem4</option>
<option value="DropdownItem5">DropdownItem5</option>
<option value="DropdownItem6">DropdownItem6</option>
<option value="DropdownItem7">DropdownItem7</option>
<option value="DropdownItem8">DropdownItem8</option>
<option value="DropdownItem9">DropdownItem9</option>
</select>

<%

dim Order
Order = Request("DropdownMenu")

Response.Write ("<select name=""DropdownMenu"" size=""2"">" & VbCr & "<option")

if Order = "DropdownItem1" then
Response.Write ("Order")
end if

Response.Write (">DropdownItem1</option>" & VbCr)

' Do this for each option

Response.Write ("</select>" & VbCr)
%>

</form>

Thanks for all your help,
John316


Quote:
Originally posted by pickledAvenger
You have changed the name of the variable which you are loading the result into (= Request). This is fine, but you will also need to change the varaible name in the IF statement, so for your code all the if statements would need to read 'IF Order = "ans1" then' etc.

If you want send me the pages and I'll take a look.

Dan
Reply With Quote
  #10 (permalink)  
Old 10-29-02, 12:19
pickledAvenger pickledAvenger is offline
Registered User
 
Join Date: Apr 2002
Location: England
Posts: 21
Could you send us update.asp as well, we can then chack that the information is being returned correctly
Reply With Quote
  #11 (permalink)  
Old 10-29-02, 13:31
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
Dan

Please past this file into an web editor and save as an .asp file

John316

Quote:
Originally posted by pickledAvenger
Could you send us update.asp as well, we can then chack that the information is being returned correctly
Attached Files
File Type: txt checkava.txt (6.4 KB, 94 views)
Reply With Quote
  #12 (permalink)  
Old 11-01-02, 23:59
John316 John316 is offline
Registered User
 
Join Date: Sep 2002
Posts: 68
PLEASE HELP ME

Can Anyone help me?

John316
Reply With Quote
  #13 (permalink)  
Old 11-02-02, 08:20
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Code:
<option Selectedvalue="25/11/2002">25/11/2002</option>
you need a space between Selected and value


rudy
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On