473,387 Members | 1,611 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Get the server side value to Drop Down Menu

Joe
For the drop down box, how do we get the server side value
For example, the following won't work because it produce
<select name="streetdirectional" value="E">. But we need
<OPTION VALUE="E" SELECTED>E</OPTION

Example:
<P>Text Box<INPUT TYPE="TEXT" name="streetNumber" value="<%= streetNumberPrefix %>"><P>Drop Down Menu <SELECT name="streetDirectional" value="<%= streetDirectional %>"><OPTION VALUE="selectone">-- Select One --</OPTION><OPTION VALUE="E">E</OPTION><OPTION VALUE="N">N</OPTION></SELECT

any ideas? thanks!
Jul 19 '05 #1
4 4114
<%
'// thispage.asp
'//
'// Process it
Dim psform
psform = request.form("SelectOptions")
if psform <> "" then
%>
<b><%=psform%></b>
<%
else
%>
<%
end if
%>

'// Form
<form method="post" action="thispage.asp">

<select name="SelectOptions">
<option selected> First option
<option> Second option option
</select>

<input type="submit" value="Submit">

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Joe <an*******@discussions.microsoft.com> wrote in message
news:D2**********************************@microsof t.com...
For the drop down box, how do we get the server side value?
For example, the following won't work because it produces
<select name="streetdirectional" value="E">. But we need
<OPTION VALUE="E" SELECTED>E</OPTION>

Example:
<P>Text Box<INPUT TYPE="TEXT" name="streetNumber" value="<%= streetNumberPrefix %>"><P>Drop Down Menu <SELECT name="streetDirectional"
value="<%= streetDirectional %>"><OPTION VALUE="selectone">-- Select
One --</OPTION><OPTION VALUE="E">E</OPTION><OPTION
VALUE="N">N</OPTION></SELECT>
any ideas? thanks!

Jul 19 '05 #2
Joe
Steven

I think you mistook my point. Sorry I didn't make it clear. I have 2 ASP pages, they both have identical controls. When page1.asp make a choice in drop down menu, and submit the form. In page2.asp I want to get that valu

<%= selectoptions %> is fine, but I need to make this value SELECTED in page2.asp, then I get stucked

please advise. Thanks!!
Jul 19 '05 #3
There was a discussion on doing this recently and apparently, you can't.

--
Regards

Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk

Keeping it FREE!

Disclaimer:
I know I'm probably wrong, I just like taking part ;o)
Joe <an*******@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
Steven,

I think you mistook my point. Sorry I didn't make it clear. I have 2 ASP pages, they both have identical controls. When page1.asp make a choice in
drop down menu, and submit the form. In page2.asp I want to get that value
<%= selectoptions %> is fine, but I need to make this value SELECTED in page2.asp, then I get stucked.
please advise. Thanks!!

Jul 19 '05 #4
You would need to do some conditional logic, create an array for the values
in the dropdown and do a loop on page2.
In the loop say :-
If this value in the array equals the value of streetdirectional from page1
Then
'<OPTION VALUE="Value in Array" SELECTED>Value in Array</OPTION>'
Else
'<OPTION VALUE="Value in Array">Value in Array</OPTION>'
End If

So, the if decides if it's the same and then pop'selected' into the option.

Hope that helps

Stu

"Joe" <an*******@discussions.microsoft.com> wrote in message
news:6A**********************************@microsof t.com...
Steven,

I think you mistook my point. Sorry I didn't make it clear. I have 2 ASP pages, they both have identical controls. When page1.asp make a choice in
drop down menu, and submit the form. In page2.asp I want to get that value
<%= selectoptions %> is fine, but I need to make this value SELECTED in page2.asp, then I get stucked.
please advise. Thanks!!

Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: KK | last post by:
Drop-down menus are the hottest thing since Wonder Bread but . . . 1. Alot of people put them in the they-look-nice-but-you-cant-code-them-right-so-they-always-look-messed-up category (a la...
0
by: vikram.cvk | last post by:
Hello Experts, Im trying to design a CSS vertical drop down menu which should have the following functionality. Home About Us | -->Overview
4
by: simon.cigoj | last post by:
I have an javascript made menu and some forms with the dropdown element. When the menu opens and scrolls down the drop down is displeyed over the menu and obscures the menu choices. I have this...
2
by: Parz | last post by:
Hi am facing problem in retrieving the value selected from drop down menu in one page from the next page..Am using the following code to populate the drop down menu with values form the database. ...
2
by: jimmyg123 | last post by:
Hi, I have used a loop so there are a number of quantity drop down menu's designed for a shopping cart style website, with $i being the loop counter and qty being the name of the drop down menu so I...
4
by: TycoonUK | last post by:
Hi, As I do not have IE7 on my computer, I was wondering if there is a fault in my CSS Menu when using IE7. Please can someone look at my site - http://www.worldofmonopoly.co.uk and tell me...
1
by: azeemqaiser | last post by:
Hi All, I have a form with two drop down controls. I want to change the values of Drop Down Menu 2 if i select some value in Drop Down Menu 1. Like If i select country then all the states of...
3
by: SQLjunky | last post by:
Hello, Contrary to what my screen name indicates, i'm actually quite new to SQL. Having said that, I'll get right into my problem. I'm trying to query an mssql database to return to the value...
7
controlbox
by: controlbox | last post by:
I have recently inplemented some drop-down lists (combos) on a page where one is dynamically populated according to the selection of another using the microsoft ajax extensions. I had to set...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.