473,545 Members | 2,019 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Drop Down Menu Question

Hi,
I have a drop down menu that is being populated by a query to the access
database

---- Code ---

Skill needed
<SELECT size="1" NAME="SkillType " VALUE="SkillTyp e">
<OPTION>
<%=SkillType% >
</option>
</select>
<P>
Gender
<select size="1" name="GenderTyp e">
<option>
<%=GenderType %>
</option>
</select>
</P>

Ethnicity
<select size="1" name="EthnicTyp e">
<option>
<%=EthnicType %>
</option>
</select>

---End Code ----

Now when the values are submitted, I use

Request.Form("E thnicType")
Request.Form("G enderType")
Request.Form("S killType")
to get the values, but all I get is the option number .. like 1 for Male
and 2 for Female in case of Gender Type. How can I make it, where it would
give me Male or Female instead.. that is .. the value that is selected in
the dropdown menu.

If this is not clear then I can post the whole sricpt .. which is not too
big.

Thanks

JB
Jul 19 '05 #1
5 5881
SPA
Normally in the dropdown items, if the value for each item is not specified,
then the index number is taken as its value even if the display text is
different.

Hence if you have
<SELECT size="1" NAME="SkillType ">
<OPTION value="<%=Skill Type%>">
<%=SkillType% >
</OPTION>
</SELECT>

This will ensure that each Skill item in the drop down has the same value as
the display text - which is what you want :)

HTH
SPA

"Jim Bo" <Yo*******@yaho o.com> wrote in message
news:Xn******** *************** ********@207.69 .154.205...
Hi,
I have a drop down menu that is being populated by a query to the access database

---- Code ---

Skill needed
<SELECT size="1" NAME="SkillType " VALUE="SkillTyp e">
<OPTION>
<%=SkillType% >
</option>
</select>
<P>
Gender
<select size="1" name="GenderTyp e">
<option>
<%=GenderType %>
</option>
</select>
</P>

Ethnicity
<select size="1" name="EthnicTyp e">
<option>
<%=EthnicType %>
</option>
</select>

---End Code ----

Now when the values are submitted, I use

Request.Form("E thnicType")
Request.Form("G enderType")
Request.Form("S killType")
to get the values, but all I get is the option number .. like 1 for Male
and 2 for Female in case of Gender Type. How can I make it, where it would
give me Male or Female instead.. that is .. the value that is selected in
the dropdown menu.

If this is not clear then I can post the whole sricpt .. which is not too
big.

Thanks

JB

Jul 19 '05 #2
Unfortunately that didn't work. I am still getting the same exact
result... any other suggestions....
JB
"SPA" <sh***********@ usswi.com> wrote in
news:#p******** ******@TK2MSFTN GP09.phx.gbl:
Normally in the dropdown items, if the value for each item is not
specified, then the index number is taken as its value even if the
display text is different.

Hence if you have
<SELECT size="1" NAME="SkillType ">
<OPTION value="<%=Skill Type%>">
<%=SkillType% >
</OPTION>
</SELECT>

This will ensure that each Skill item in the drop down has the same
value as the display text - which is what you want :)

HTH
SPA

"Jim Bo" <Yo*******@yaho o.com> wrote in message
news:Xn******** *************** ********@207.69 .154.205...
Hi,
I have a drop down menu that is being populated by a query to the

access
database

---- Code ---

Skill needed
<SELECT size="1" NAME="SkillType " VALUE="SkillTyp e">
<OPTION>
<%=SkillType% >
</option>
</select>
<P>
Gender
<select size="1" name="GenderTyp e">
<option>
<%=GenderType %>
</option>
</select>
</P>

Ethnicity
<select size="1" name="EthnicTyp e">
<option>
<%=EthnicType %>
</option>
</select>

---End Code ----

Now when the values are submitted, I use

Request.Form("E thnicType")
Request.Form("G enderType")
Request.Form("S killType")
to get the values, but all I get is the option number .. like 1 for
Male and 2 for Female in case of Gender Type. How can I make it,
where it would give me Male or Female instead.. that is .. the value
that is selected in the dropdown menu.

If this is not clear then I can post the whole sricpt .. which is not
too big.

Thanks

JB



Jul 19 '05 #3
Then you either didn't do what he suggested, or you aren't telling us
something.
Is SkillType a field in your database, what are it's values?

"Jim Bo" <Yo*******@yaho o.com> wrote in message
news:Xn******** *************** ********@207.69 .154.206...
Unfortunately that didn't work. I am still getting the same exact
result... any other suggestions....
JB
"SPA" <sh***********@ usswi.com> wrote in
news:#p******** ******@TK2MSFTN GP09.phx.gbl:
Normally in the dropdown items, if the value for each item is not
specified, then the index number is taken as its value even if the
display text is different.

Hence if you have
<SELECT size="1" NAME="SkillType ">
<OPTION value="<%=Skill Type%>">
<%=SkillType% >
</OPTION>
</SELECT>

This will ensure that each Skill item in the drop down has the same
value as the display text - which is what you want :)

HTH
SPA

"Jim Bo" <Yo*******@yaho o.com> wrote in message
news:Xn******** *************** ********@207.69 .154.205...
Hi,
I have a drop down menu that is being populated by a query to the

access
database

---- Code ---

Skill needed
<SELECT size="1" NAME="SkillType " VALUE="SkillTyp e">
<OPTION>
<%=SkillType% >
</option>
</select>
<P>
Gender
<select size="1" name="GenderTyp e">
<option>
<%=GenderType %>
</option>
</select>
</P>

Ethnicity
<select size="1" name="EthnicTyp e">
<option>
<%=EthnicType %>
</option>
</select>

---End Code ----

Now when the values are submitted, I use

Request.Form("E thnicType")
Request.Form("G enderType")
Request.Form("S killType")
to get the values, but all I get is the option number .. like 1 for
Male and 2 for Female in case of Gender Type. How can I make it,
where it would give me Male or Female instead.. that is .. the value
that is selected in the dropdown menu.

If this is not clear then I can post the whole sricpt .. which is not
too big.

Thanks

JB


Jul 19 '05 #4
Okay.. here is the full script (minus some html crap) that is passing on
the values.. I am still getting the same results..

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<link rel="stylesheet " type="text/css" href="css/styles1.css"/>

</head>
<body>
<%
'Dimension variables
Dim adoCon 'Holds the Database Connection Object
Dim rsSeniors 'Holds the recordset for the records in the database
Dim strSQL 'Holds the SQL query for the database

'Create an ADO connection object
Set adoCon = Server.CreateOb ject("ADODB.Con nection")

'Set an active connection to the Connection object using a DSN-less
connection
adoCon.Open "DRIVER={Micros oft Access Driver (*.mdb)}; DBQ=" &
Server.MapPath( "VolunteerDatab ase/volunteersandci tizens.mdb")
'Create an ADO recordset object
Set rsSeniors = Server.CreateOb ject("ADODB.Rec ordset")

'THIS CODE IS FOR SKILLS DROP DOWN BOX.
'Initialise the strSQL variable with an SQL statement to query the
database
strSQL ="SELECT TProfiles.lngPr ofileID, TProfiles.strPr ofileDescriptio n
FROM TProfiles;"
'Open the recordset with the SQL query
rsSeniors.Open strSQL, adoCon, adOpenKeyset

'loop through the recordset.
DO WHILE NOT rsSeniors.EOF

SkillType = SkillType & "<option value=" & rsSeniors("lngP rofileID")
& ">" & rsSeniors("strP rofileDescripti on") & "</option>"
rsSeniors.MoveN ext

LOOP
' Close the connection.
rsSeniors.Close
' END OF CODE FOR SKILLS DROP DOWN BOX.


'THIS CODE IS FOR GENDER DROP DOWN BOX.
'Initialise the strSQL variable with an SQL statement to query the
database
strSQL ="SELECT TGenders.lngGen derID, TGenders.strGen der from TGenders;"

'Open the recordset with the SQL query
rsSeniors.Open strSQL, adoCon, adOpenKeyset

'loop through the recordset.
DO WHILE NOT rsSeniors.EOF

GenderType = GenderType & "<option value=" & rsSeniors("lngG enderID")
& ">" & rsSeniors("strG ender") & "</option>"
rsSeniors.MoveN ext

LOOP
' Close the connection.
rsSeniors.Close
' END OF CODE FOR GENDER DROP DOWN BOX.

'THIS CODE IS FOR ETHNIC DROP DOWN BOX.
'Initialise the strSQL variable with an SQL statement to query the
database F
strSQL ="SELECT TEthnicities.ln gEthnicityID, TEthnicities.st rEthnicity
FROM TEthnicities;"

'Open the recordset with the SQL query
rsSeniors.Open strSQL, adoCon, adOpenKeyset

'loop through the recordset.
DO WHILE NOT rsSeniors.EOF

EthnicType = EthnicType & "<option value=" & rsSeniors
("lngEthnicityI D") & ">" & rsSeniors("strE thnicity") & "</option>"
rsSeniors.MoveN ext

LOOP
'Reset server objects
rsSeniors.Close
'END OF CODE FOR ETHNIC DROP DOWN BOX.

'THIS CODE IS FOR SENIOR INFORMATION.

lngSeniorInfo = CLng(Request.Qu eryString("ID") )

'Initialise the strSQL variable with an SQL statement to query the
database
strSQL = "SELECT TSeniors.* FROM TSeniors WHERE TSeniors.lngSen iorID =" &
lngSeniorInfo & ";"

'Open the recordset with the SQL query
rsSeniors.Open strSQL, adoCon

'END OF CODE FOR SENIOR DETAIL DATA QUERY.

%>

<form method="POST" action="MatchSe archIII.asp">
<table border="1">
<tr>
<td>Full Name</td>
<td><% =rsSeniors("str FirstName") %> &nbsp;
<% =rsSeniors("str MiddleName") %>&nbsp;
<% =rsSeniors("str LastName") %></td>
</tr>

<tr>
<td>Address</td>
<td><% =rsSeniors("str Address") %></td>
</tr>

<tr>
<td>City</td>
<td></font><% =rsSeniors("str City") %></td>
</tr>

<tr>
<td>Zip Code</td>
<td><% =rsSeniors("str ZipCode") %></td>
</tr>

<tr>
<td>Phone</td>
<td><% =rsSeniors("str PhoneNumber") %></td>
</tr>
</table>

Skill needed
<SELECT size="1" NAME="SkillType ">
<OPTION Value="<%=Skill Type%>">
<%=SkillType% >
</option>
</select>
<P>
Gender
<select size="1" name="GenderTyp e">
<option value="<%=Gende rType%>">
<%=GenderType %>
</option>
</select>
</P>

Ethnicity
<select size="1" name="EthnicTyp e">
<option value="<%=Ethni cType%>">
<%=EthnicType %>
</option>
</select>

<Table>

<td height="51" colspan=2><inpu t type="Submit" name="Submit"
value="Find Match"> &nbsp; &nbsp;
<input type="Submit" name="Cancel" value="Cancel">
</td>

</Table>

</form>

<!-- End form code -->
<%
rsSeniors.Close
Set rsSeniors = Nothing 'Nulls the dataset.
Set adoCon = Nothing 'Closes the database connection.
%>

</body>
</html>
Jul 19 '05 #5
> SkillType = SkillType & "<option value=" & rsSeniors("lngP rofileID")
& ">" & rsSeniors("strP rofileDescripti on") & "</option>"
Since you're already including the <option> tags in your string, you don't
need to include them further down the page...
<SELECT size="1" NAME="SkillType ">
<OPTION Value="<%=Skill Type%>">
<%=SkillType% >
</option>
</select>


This should be.....

<SELECT size="1" NAME="SkillType ">
<%=SkillType% >
</select>

Then, to display Male or Female instead of 1 and 2, use a Select Case....

Select Case Request.Form("G enderType")
Case 1
GenderType = "Male"
Case 2
GenderType = "Female"
End Select

Jul 19 '05 #6

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

Similar topics

3
2945
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 "frames"). Do you think this is true> 2. Some people think they take up too much KB. 3. Some people are worried that people who have javascript turned off...
6
15398
by: Greg Scharlemann | last post by:
I am attempting to populate a drop down menu based on the selection of a different drop down menu. However, it is not working correctly, I cannot figure out for the life of me what exactly happens because I am not getting any errors on the page. <html> <script language="javascript"> var phaseArray = new phaseArray(4); var phaseTypeId =...
0
16150
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
2643
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 problem only in IE, in firefox it works ok. Is there a solution to this problem? I tried to hide the drop down when the menu opens but sometimes...
3
1543
by: phil | last post by:
We are developing specs. for a website for a nonprofit org, with database for membership related functions. But..question is regarding drop down menu links. We will have 20 category-pages, and each page will have 30-50 links- unique to that page, so 1000+ total for site- on a drop down menu. Need we assume that such links (both plain...
17
14788
by: Aussie Rules | last post by:
Hi, I want to have a single line combo box dropdown, but where i can selected multiple items in the drop down via a check box... I can see one in the standard tool box... is there one ? If not any suggestions as to where to get one from.
1
2852
by: phpnewb | last post by:
Hi, I know i'm doing it wrong, but I'm using a while loop right now to create several instances of a drop down menu. It gives me undesirable results. Can you tell me the right way to do it. Below are a bit of information on what i did if you want t read it. When I choose select an option in the drop down menu and hit submit, I increase a...
6
8288
by: mcgrew.michael | last post by:
I hope this is the right group. I am very new to ASP so this is probably a stupid question. I have some vbscript that query's AD and populates a recordset. I know the recorset contains the information I want by doing a Response.write. I am having problems dynamically creating a drop down list from the data in the recordset. The drop down is...
4
9276
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 if it works, and if it does not, tell me why it does not work. Thanks.
2
1480
by: laredotornado | last post by:
Hi, If any of you have a Google home page ... http://www.google.com/ig you'll notice that when you click on the drop down arrow graphic for each module, there is a drop down menu that appears. You can move the module around the page and the drop down menu always appears under the arrow. Does anyone have any recommendations as the best...
0
7468
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7401
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7656
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7808
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7423
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5329
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4945
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3443
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.