Redirecting to different pages based on the selection of the user

User can select one option from a drop down list box , based on the option value the page can be redirected to different URLs .

Here we will keep URLs as option values for each selection.
Here is the demo. This will redirect to this page only after the selection but you can use different URL.
We use on change event of a list box.


<select class='form-control' name='s1' id=city_id>
  <option value=''>Select One City</option>
  <option value=''>London</option>
  <option value=' York'>New York</option>
  <option value=' Delhi'>New Delhi</option>
  <option value=''>Paris</option>

$(document).ready(function() {
$("#city_id").change(function(){ // change function of listbox
window.location = $('#city_id').val();
Visitors Rating
Your Rating

Post Comment This is for short comments only. Use the forum for more discussions.

Most Popular JQuery Scripts


Two dependant list boxes


Calendar with Date Selection


Data change by Slider


Show & Hide element
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 All rights reserved worldwide Privacy Policy Disclaimer