Action button and dropdown list

Author Message

Sandra Parente

Wednesday 06 April 2005 3:26:17 am

I want to let users to select an article in a folder from a dropdown list and then click an action button to go to the selected article. I have tried in many ways, but the action button dosn't work: I find myself always in the folder node. This is my (last) code:

<form method="post" action={$node.url_alias|ezurl}>
            <div class="content-view-children">
		<select name="ChildrenList[{$node.node_id}]">
                {section var=child loop=$list_items sequence=array}
                    <option value="{$node.node_id}">{node_view_gui view=line content_node=$child}</option>
                {/section}
		</select>
<input class="button" type="submit" name="ChildSelect" value="Go" />
            </div>
</form>

Which is the right "action" code?

Sandra Parente
www.netbliss.it

Sandra Parente

Wednesday 06 April 2005 8:23:19 am

I've seen that actions are set in browse.ini
Maybe we must before set some kind of action here?

Sandra Parente
www.netbliss.it

Eivind Marienborg

Wednesday 06 April 2005 8:38:52 am

the "action" code tells the browser where to send the form values. So unless there is something at the adress you specify that handles your form, it won't do anything.

you could try this:

<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>



<form name="form1" width=30>

<select name="menu2" size="20" style="font-size:9px" onChange="MM_jumpMenu('parent',this,0)">

                {section var=child loop=$list_items sequence=array}
                    <option value="{$node.node_id}">{$node.name}</option>
                {/section}

</select>
</form>

Sandra Parente

Thursday 07 April 2005 2:37:55 am

Thanks Eivind, but javascript creates many problems to pagelayout and children loop in folder.tpl...
I think I need another solution.

Sandra Parente
www.netbliss.it

Sandra Parente

Friday 08 April 2005 12:52:09 am

Any advice from eZ staff? Perhaps there is no solution?

Sandra Parente
www.netbliss.it

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.