Forums / Setup & design / Sorry, back again : Is it possible to make a dynamic drop down list ?

Sorry, back again : Is it possible to make a dynamic drop down list ?

Author Message

laurent le cadet

Friday 24 October 2003 6:12:19 am

Hi (again),

I'm sorry to ask this question again, but I send a message 4 days ago without any answer.
I'm trying to make a drop down list with ez 3.1 but I just found 1 message about this.
It makes me think it's a very basic thing but I can't do it by myself.
Here's my code :

<form action="/index.php/content/view/full/" method="get">
<select name="ville" id="ville">
<option value="Villes" selected="selected">Villes</option>
{section name=top loop=fetch( content, list, hash( parent_node_id, 943 ) )}
<option value="{$:item.contentobject_id}">{$:item.name|wash}</option>
{/section}
</select>
<input name="ok" type="submit" class="button" id="ok" value="ok" />
</form>

The answer of the browser seems to be correct (...content/view/full/?ville=1008&ok=ok) but it just print "object unvailable".

Someone can tell me if it'd possible that way and what is the right code ?

Any help will be very welcome.

Laurent.

Marco Zinn

Friday 24 October 2003 12:07:49 pm

What do you want the form to do? The "action" of the above form will always give you a URL, that ez cannot understand. Is "1008" the node-ID, that you want to browse to, so you want a "drop-down-navigator"?

Marco
http://www.hyperroad-design.com

laurent le cadet

Saturday 25 October 2003 1:36:57 am

Hi Marco,

Yes 1008 is the node I want to browse to. In fact, I have a folder with about 150 nodes so I prefer to have a drop down than a long long list of items.

You have a solution to my pb ?

Laurent.

Paul Forsyth

Saturday 25 October 2003 7:49:55 am

Haven't tried this out but your code seems wrong because it refers to the contentobject_id. content/view/full expects a node id as a parameter. Instead, try:

$:item.node_id

Paul

laurent le cadet

Monday 27 October 2003 12:01:50 am

Hi Paul,

Still the same.

.../content/view/full/?ville=1008&ok=ok : "object unvailable".

Is there something to write in an ini file to convert the last part of the url in an object ID ?

Laurent.

Paul Forsyth

Monday 27 October 2003 4:39:16 am

I assume:

http://<site>/content/view/full/1008

gives you the right view as expected?

I can't see how your code will work. Have you custom
code underneath to take your 'ville' parameter and create a valid URI from it?

paul

laurent le cadet

Monday 27 October 2003 5:16:43 am

Yes, that's right, http://<site>/content/view/full/1008 is the URI I want to target.

For the custom code I just have nothing. I don't know how and where to create it.
I presume there is something to override somewhere ?

Paul Forsyth

Monday 27 October 2003 5:46:51 am

Try some javascript:

<select name="ville" id="ville" onchange="window.location=this.form.ville.options[this.form.ville.selectedIndex].value;">

Make sure you change the text i mentioned:

{$:item.contentobject_id} to {$:item.node_id}

Paul

laurent le cadet

Monday 27 October 2003 5:56:07 am

Paul,

PERFECT !

Thanks a lot.

I'm sure this will help.

Laurent.

zaxofeel .v

Tuesday 27 March 2007 1:36:25 am

I've a question that might be related to the thread,
did anyone here try to implement a dymanic drop down menu that its items depend on another list?
somthing like this:
http://www.plus2net.com/php_tutorial/dd.php

zaxofeel .v

Wednesday 04 April 2007 4:41:46 am

hi :)
didn't anyone try that b4?
actually i am in great need for it
I need to fill three select lists, the firs one has the top level objects and on selection an object, the second list is to be filled with its children, and so on for the third list
any help?