Ask Experts » Blogging and Websites » Web design »

Need combo dropdown box script idea


Date: 18 Apr 2015   Posted By: Mukhtar     Group: Blogging and Websites    Category: Web design   

I want to create script of combo dropdown box with three boxes for my traveling website. I just want to keep it simple.

In first box there is only one default option "Somnath".
In other box there is only one default option "Dwaraka"
The main option is third I want to put 10 option in this box. Number 1 to 10. This are the number of tickets to book online.

Now if customer select 1 and click on submit- page11111111.com opens
Now if customer select 2 and click on submit - page22222222.com opens

Every 10 option have 10 new pages which will open in new Tab or New page.

If any one know to create such script please provide tutorial of such script.


Want to install a drop down box with varied combinations at your travel website? Get a free tutorial to know how to install the script to put in a combo drop down box at your website.


Author: vijay kumar rana    12 Jan 2016      Member Level: Silver     Points : 8  (Rs 8)    Voting Score: 0

By analyzing your question, I came up to a decision to reply.
As your main aim is to use the option for redirecting the page after selecting various option to various page, why can't you do it by using jquery. Jquery is a Javascript library. Its really simple to use.

Try below sample code.

$(document).ready( function() {
$('#myId').change( function() {
location.href = $(this).val();
});
});


< select id="myId" >
< option value="#">Select a Option
< option value="1111.htm">Location
< option value="2222.htm">Other
< /select >


When you select the Location option, you will be redirect to the location.html. This is done by jquery. The script is loaded after document load. As you change the option, jquery change the location of href and redirect to that location.

Hope this helps you. Happy Coding :)





Post Answer



You must Sign In to post a response.


Post Answer        





Related Questions
  • Return to Question Index
  • Ask Question to Experts


  • Top Contributors
    TodayLast 7 Daysmore...