Submit Your Article Forum Rules

Results 1 to 6 of 6

Thread: How do I implement a look up table ?

  1. #1
    Junior Member
    Join Date
    Jul 2003
    Posts
    20

    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.

  2. #2
    Senior Member paulhiles's Avatar
    Join Date
    Jul 2003
    Posts
    2,073

    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

  3. #3
    Senior Member
    Join Date
    Feb 2004
    Posts
    216
    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.

  4. #4
    Senior Member
    Join Date
    Feb 2004
    Posts
    216
    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.

  5. #5
    Senior Member paulhiles's Avatar
    Join Date
    Jul 2003
    Posts
    2,073
    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

  6. #6
    Junior Member
    Join Date
    Jul 2003
    Posts
    20

    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.

Similar Threads

  1. What kind of strategies do you normally implement for back links?
    By Della Emery in forum Search Engine Optimization Forum
    Replies: 10
    Last Post: 03-23-2010, 05:45 AM
  2. How to implement .swf movie files in Swish Max3?
    By davin in forum Graphics & Design Discussion Forum
    Replies: 5
    Last Post: 10-29-2009, 09:39 AM
  3. How to implement RSS feeds
    By watto in forum Search Engine Optimization Forum
    Replies: 1
    Last Post: 07-28-2008, 05:56 AM
  4. How do I implement 301 redirect with html?
    By DVDStar in forum Search Engine Optimization Forum
    Replies: 22
    Last Post: 06-22-2008, 04:56 PM
  5. Table Align to table
    By sysop9999 in forum Graphics & Design Discussion Forum
    Replies: 3
    Last Post: 11-10-2005, 10:00 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •