|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
I have a website devoted to driving holidays in the USA. I have coded the site by hand in notepad as I wanted to learn HTML. I would like to introduce a feature where a site user selects a starting city from a drop down menu and a destination city from another drop down. The web page then gives the distance and driving time between the two. Where do I start ? I could do this in basic with and array of data but I dont know where to start in HTML or java and I have not been able to find out by searching the web. --- Help !!
__________________
http://www.uk-2-usa.com All kinds of help for UK visitors planning USA fly drives. |
|
||||
|
This javascript combo select box could potentially form part of your setup, it all depends on the scale of your project. The arrays could become a bit of a headache if your lists of destinations are in the hundreds!
So if it's a large scale operation with lots of potential permutations / outcomes, you're best using ASP or PHP to programatically populate your select dropdown options. Paul |
|
|||
|
mmmm, well as far as populating the dropdown menus your better off with a server side language like php. Here you could have a comma seperated file with all the cities you list that are read in to populate the drop down boxes. Or if you have it a database connection to extract the values. Or just hand code them all into the drop down boxes.
As far as calculating the distance between the two cities. Your going to need an external service provider for this. I dont think there are any free ones out there. But, you could link your form to an external site like the RAC route planner with the values. Im mummbling on a little here, ill show you what i mean in next post.
__________________
Clearlime - leeds,west yorkshire web design |
|
|||
|
Hi,
Ok look at www.map24.com they have a free link2 service whereby you can pass the start and destination information for the two cities and they will display a map and the distance and time. This will take away from your site though so you might want to pass the values to one of your pages and open map24 through a pop-up window. Have a look anyway its free to register.
__________________
Clearlime - leeds,west yorkshire web design |
|
||||
|
Excellent find Chris! I've been playing with the UK version of the site and I'm really impressed!
Pity it relies so heavily on the Java platform, but saying that, the functionality more than makes up for this! Paul |
|
|||
|
Many thanks for everybody for taking the time to reply.
I have lifted bits from various scripts and come up with my version of what I wanted to do. Its at http://www.uk-2-usa.com/California.html#routeplanning Its a nightmare to create something like this in terms of formatting the data and I'm sure the code is poor quality but the end result is just about what I was after. The mention of having comma separated variables and extracting them sounds very attractive. Where do I find out about php ?
__________________
http://www.uk-2-usa.com All kinds of help for UK visitors planning USA fly drives. |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |