How to change url based on input type selected using javaScript/Jquery? <p>I have a form </p> <pre><code> &lt;form name="categoryform" method="post"&gt; Category:&lt;select name="category" id="category" &gt; &lt;option value="games"&gt;games&lt;/option&gt; &lt;option value="books"&gt;books&lt;/option&gt; &lt;option value="toys"&gt;toys&lt;/option&gt; &lt;option value="clothes"&gt;clothes&lt;/option&gt; &lt;/select&gt; Age: &lt;select multiple name="age" id="age" &gt; &lt;option value="5"&gt;5&lt;/option&gt; &lt;option value="10"&gt;10&lt;/option&gt; &lt;option value="15"&gt;15&lt;/option&gt; &lt;/select&gt; &lt;input type="submit" name="submit" value="submit"/&gt; &lt;/form&gt; </code></pre> <p>Initially the url is <code>http://localhost/childzone/</code></p> <p>If I select the option <code>books</code> from Category the URL must change to <code>http://localhost/childzone/books</code> and when I select option <code>clothes</code> the url must be <code>http://localhost/childzone/clothes</code>.</p> <p>If I also select age=5 from the dropdown <code>age</code> the url must be <code>http://localhost/childzone/clothes&amp;age=5</code>. For multiple options selected i.e, if I select 5 and 10 both from <code>age</code> the url must be <code>http://localhost/childzone/clothes&amp;age=5,10</code>.</p> <p>How do I get such a URL. I am new to php, can anyone help. Thank you in advance</p>