Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2005, 08:02 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default option values

Hello all
i have a select menu and one of the option lables is "All" that has the value of s and w.how can i 2 value for one option?
the code is something like this:
<select name="1">
<option value="s,w">All</option>
</select>

 
Old September 18th, 2005, 03:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Why do you need two options? And why wouldn't the code below work? It will pass two selected items...

When multiple option elements in a list are selected, they are separated by a comma. So, by adding a comma between your two values in a single element, your ASP page will interpret this as two selected items.

You can use another symbol, e.g. s|w to separate them, or simply use something like ALL to indicate that All was selected.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Ego Brain by System Of A Down (Track 12 from the album: Steal This Album) What's This?
 
Old September 19th, 2005, 12:01 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

thank you for your answer.that'a long time that i haven't seen any messages writing in forum.i have dependent select menus in my page.wich parent select gave its values from database.but i want to have all option to select all options in parent menu.when i use the code above by selecting all i can't see anything in child menu

 
Old September 19th, 2005, 01:00 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That's probably because your code assumes you're only passing one value. I haven't seen your code for the second drop-down but I assume it's something like this:
Code:
Dim selectedValue
Dim sql
selectedValue = Request.Form("1")
sql = "SELECT Col1, Col2 FROM Table WHERE PrimKey = '" & selectedValue & "'"
In normal circumstances, the WHERE clause will look like
Code:
WHERE PrimKey = 's'
However, in the "multiple values" option, it will look like this:
Code:
WHERE PrimKey = 's,w'
which won't give you any results.

You should parse Request.Form("1") by splitting on a comma and then build up a WHERE clause dynamically using OR.
You can also take a look at the IN clause of a WHERE statement.E.g.
Code:
WHERE PrimKey IN ('s', 'a')
An even better solution is to leave out the WHERE clause at all when Request.Form("1") equals "all":
Code:
If Request.Form("1") = "all" Then
  ' Do nothing
Else
  sql = sql & " WHERE bla bla bla "
End If
HtH,

Imar
 
Old September 19th, 2005, 04:36 AM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

the child menu is as below:
<select name="HGNo" id="HGNo" wdg:subtype="DependentDropdown" wdg:type="widget" wdg:recordset="rs1" wdg:displayfield="HGNo" wdg:valuefield="HGNo" wdg:fkey="SiteWorkshop" wdg:triggerobject="SiteWorkshop" wdg:selected="<%=(rs.Fields.Item("SiteWorkshop").V alue)%>">
                    </select>
i used MX kollection and i don't know where should i use these codes

 
Old September 19th, 2005, 04:51 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

I don't know MX kollection so I don't know where to add it either....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old September 23rd, 2005, 11:56 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

MX Kollection is one of the server bevavours that i downloaded it form macromedia site and has many facilities. one of them is making dependent menus and i used this.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Create Check Boxes/Option buttons/Option Group hewstone999 Access VBA 1 March 14th, 2008 07:25 AM
if option kgoldvas XSLT 1 May 14th, 2007 09:39 AM
C# and WinXP Customize Regional Option Values slau C# 1 May 3rd, 2007 07:20 AM
option values hastikeyvan Dreamweaver (all versions) 3 October 13th, 2005 01:19 AM
loop values and text box values move mateenmohd Classic ASP Basics 2 April 5th, 2005 11:33 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.