<?php echo $this->getUrl(); ?> gives me my index page url .i.e. http://www.domain.com/index.php/
But now, what 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=""> </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>
With this (note that I’ve added
thisas the first argument):You could write the following JS:
Alternatively:
(EDIT Prepended
http://to both examples.)