Forums / Setup & design / Redirect with form / DropDown list

Redirect with form / DropDown list

Author Message

Norman Leutner

Thursday 29 September 2005 12:13:21 am

I want a drop down list which redirects after selection to the selected item.

<form action={"/redirect/me"|ezurl} method="post">
  <select class="input" name="RedirectTo" onChange="this.form.submit();" >
    <option value="none">(Select your application)</option>

    {section loop=fetch('content', 'list', hash( 'parent_node_id','97',
                                                 'sort_by',array(name,ascending)
                                               )
		       )
    }
      <option value="{$:item.url_alias|ezurl}">{$:item.name|wash}</option>
    {/section}
  </select>
</form>

Does anyone have a suggestion for me how to realise this without programming a own redirect extension?

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh

Norman Leutner

Thursday 29 September 2005 12:40:26 am

Ok, i got it but you need to have javascript enabled.
I think this is the best solution.

onchange="window.location=this.form.RedirectTo.options[this.form.RedirectTo.selectedIndex].value;"

<form action="" method="get">
  <select class="input" name="RedirectTo" id="RedirectTo" onchange="window.location=this.form.RedirectTo.options[this.form.RedirectTo.selectedIndex].value;">
    <option value={$node.url_alias|ezurl}>(Select your application)</option>

    {section loop=fetch('content', 'list', hash( 'parent_node_id','97',
                                                 'sort_by',array(name,ascending)
							   )
                       )
    }
      <option value={$:item.url_alias|ezurl}>{$:item.name|wash}</option>
    {/section}
  </select>
</form>

Mit freundlichen Grüßen
Best regards

Norman Leutner

____________________________________________________________
eZ Publish Platinum Partner - http://www.all2e.com
http://ez.no/partners/worldwide_partners/all2e_gmbh