Click here to Skip to main content
16,016,180 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi frnds,
hi how to navigate to next page when we select item dropdown list in html?
i have wrote code like this where to give the next page url ?
HTML
<pre lang="xml"><select>
  <option value="" selected="selected">Select</option>

  <option value="/">Home</option>
  <option value="/collections/all">Books</option>
  <option value="/blogs/five-simple-steps-blog">Blog</option>
  <option value="/pages/about-us">About Us</option>
  <option value="/pages/support">Support</option>
</select>


please help me guys . .
thank u
Posted
Comments
[no name] 3-Nov-14 1:37am    
Whats wrong with your code ?
u mani 3-Nov-14 1:39am    
when we click on home it need to navigate to index.html ..please tell me how to write code ?

Hi,

Try it this way
HTML
<form action="../">
<select onchange="window.open(this.options[this.selectedIndex].value,'_top')">
    <option value="">Select...</option>
    <option value="/Index.html">Home</option>
    <option value="/collections/all.html">Books</option>
    <option value="/blogs/five-simple-steps-blog.html">Blog</option>
    <option value="/pages/about-us.html">About Us</option>
    <option value="/pages/support.html">Support</option>
</select>
</form>


Hope this works and helps you ! :)

Regards,
Praneet
 
Share this answer
 
Comments
u mani 3-Nov-14 1:51am    
workin ..thank u .. :-)
[no name] 3-Nov-14 1:55am    
Happy to help ! Glad it worked for you :)
 
Share this answer
 
Comments
u mani 3-Nov-14 1:45am    
with out using script and css is this possible ..
<select>
<option value="" selected="selected">Select</option>

<option value="/">Home</option>
<option value="/collections/all">Books</option>
<option value="/blogs/five-simple-steps-blog">Blog</option>
<option value="/pages/about-us">About Us</option>
<option value="/pages/support">Support</option>
</select>
in this code can i write index.html any where ?
please tell me .

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900