Forums

This topic is locked

More Help Linking Dropdown Menus

Posted 26 Nov 2002 12:42:10
1
has voted
26 Nov 2002 12:42:10 Rafi Mellado posted:
Hi,
I've created a Linked Dropdown Menu using the code on Macromedia's site:
www.macromedia.com/support/ultradev/ts/documents/client_dynamic_listbox.htm

But I've encountered a bit of a problem since I'm using this code to create a database search engine. I've made it so the parent dropdown menu has a static option I've created as initially selected. When this happens the child menu automatically changes to[none available] , which is ok except I want to be able to give that option a value of % and I can't figure out how to do it.
Has anyone worked with this code lately or in the past and has a solution you could give me.

Thanks ahead of time,

DarkKave
www.marmenor.com


"If it weren't for the last minute, nothing I would get nothing done"

Replies

Replied 26 Nov 2002 15:17:41
26 Nov 2002 15:17:41 Dennis van Galen replied:
Do you mean, it always has a value of "%"?

If yes, then simply change the end of the code to:

if (oList.options.length == 0){
oList.options[oList.options.length] = <b>new Option("%",0);</b>
}

oList.selectedIndex = 0;
}

//--&gt;
&lt;/script&gt;

Hope that helps.

with regards,

Dennis van Galen
DMXzone Manager

Extension, Tutorial and FAQ's Manager
Replied 26 Nov 2002 16:58:31
26 Nov 2002 16:58:31 Rafi Mellado replied:
Sorry I wasn't too clear on the previous message. I'll try to be more specific.

I have several search fields and I want users to be able to leave any or all of them blank. My problem arises when they leave the parent dropdown menu in the default option which is "search all" (Static option with value = %)because automatically the child window displays [none available] and when the form is submitted it passes on a value for the child dropdown menu instead of the blank or "%" wildcard value I want it to pass. Which means that the user will not find any matches.
What I want is that when the child dropdown menu has the [none available] option selected it passes a value of "%" or simply a blank value instead of the 0 value I think it is passing.
I hope that clears it up a bit
thanks again
Oh BTW its www.marmenor.com/search.asp

<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
Do you mean, it always has a value of "%"?

If yes, then simply change the end of the code to:

if (oList.options.length == 0){
oList.options[oList.options.length] = <b>new Option("%",0);</b>
}

oList.selectedIndex = 0;
}

//--&gt;
&lt;/script&gt;

Hope that helps.

with regards,

Dennis van Galen
DMXzone Manager

Extension, Tutorial and FAQ's Manager
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>

"If it weren't for the last minute, nothing I would get nothing done"
Replied 26 Nov 2002 17:06:15
26 Nov 2002 17:06:15 Rafi Mellado replied:
Nevermind, I figured it out. I realized that the value of the [none selected] option in the child box was 0, and if I tried to change it the dynamic dropdown menus got all screwy, si I just told my variable in the results page that if request("selList2" was 0 to make it % and it works perfectly. Thanks anyway.
Some things just clear themselves up after a good lunch I guess.

"If it weren't for the last minute, nothing I would get nothing done"
Replied 26 Nov 2002 17:12:49
26 Nov 2002 17:12:49 Dennis van Galen replied:
What I did was add a static option in the child droplist, that way even when the [none available] is selected it will use the pre-defined value.

But I see you allready got it to work, good <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

with regards,

Dennis van Galen
DMXzone Manager

Extension, Tutorial and FAQ's Manager

Reply to this topic