how to concatinate a link with <select> <option> value on "onchange" event

Posted by atif on Stack Overflow See other posts from Stack Overflow or by atif
Published on 2011-03-07T08:02:05Z Indexed on 2011/03/07 8:10 UTC
Read the original article Hit count: 189

Filed under:
|

<?php echo $this->getUrl(); ?> = this gives me my index page url .i.e. www.domain.com/index.php/

but now wat i want is when any particular option is selected, it should add to this url. .e.g.

www.domain.com/index.php/wordpress/

i write this code for it but now don know how to get it done :(

<select onchange="setLocation('<?php echo $this->getUrl(); ?>')">
     <option value="">&nbsp;</option>
     <option value="wordpress">Wordpress</option>
     <option value="drupal">drupal</option>
     <option value="magento">Megento</option>
</select>

also i had searched this link but couldn't take help from it. As it didnt work for me.

<select name="forma" ONCHANGE="location = this.options[this.selectedIndex].value;">
 <option value="Home">Home</option>
 <option value="Contact">Contact</option>
 <option value="Sitemap">Sitemap</option>
</select>

© Stack Overflow or respective owner

Related posts about php

Related posts about magento