iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
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

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-25-2005, 08:01 PM
WebProWorld New Member
 
Join Date: Jul 2003
Location: England
Posts: 20
uk2usa RepRank 0
Default How do I implement a look up table ?

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.
Reply With Quote
  #2 (permalink)  
Old 03-29-2005, 10:31 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default Dependent select options

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
Reply With Quote
  #3 (permalink)  
Old 04-03-2005, 07:27 PM
WebProWorld Pro
 
Join Date: Feb 2004
Location: England Baby!
Posts: 216
icb01co2 RepRank 0
Default

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.
Reply With Quote
  #4 (permalink)  
Old 04-03-2005, 07:38 PM
WebProWorld Pro
 
Join Date: Feb 2004
Location: England Baby!
Posts: 216
icb01co2 RepRank 0
Default

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.
Reply With Quote
  #5 (permalink)  
Old 04-04-2005, 06:30 AM
paulhiles's Avatar
WebProWorld 1,000+ Club
 
Join Date: Jul 2003
Location: UK
Posts: 2,089
paulhiles RepRank 0
Default

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
Reply With Quote
  #6 (permalink)  
Old 04-05-2005, 09:23 AM
WebProWorld New Member
 
Join Date: Jul 2003
Location: England
Posts: 20
uk2usa RepRank 0
Default Thanks

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.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 11:32 PM.



Search Engine Optimization by vBSEO 3.3.0