Loading Data from Text File into an HTML Drop Down Box

Discussion in 'Javascript' started by Al-Bot, Dec 23, 2005.

  1. Al-Bot

    Al-Bot Guest

    Hey to all!

    How can I load data from a simple .txt file into a drop down box using
    HTML or javascript. I have this:

    <select name="Soup_1">
    <option value="Soup Choice 1">-------------- Choice 1 --------------
    <option value="CREAM OF BROCCOLI">Cream of Broccoli
    <option value="FRENCH ONION W/ CROUTONS">French Onion W/ Croutons
    <option value="HAMBURGER TOMATO SOUP">Hamburger Tomato
    <option value="LOW SODIUM CHICKEN RICE">Low Sodium Chicken Rice
    <option value="LOW SODIUM BEEF BARLEY">Low Sodium Beef Barley
    <option value="LOW SODIUM BEEF NOODLE">Low Sodium Beef Noodle
    <option value="SPLIT PEA">Split Pea
    </select>

    This list will grow and I would rather not have it in the webpage it's
    self, I would like the 'Soups" loaded from a text file. How can I do
    this?

    THANK YOU!!!
     
    Al-Bot, Dec 23, 2005
    #1
    1. Advertising

  2. Al-Bot wrote:

    > How can I load data from a simple .txt file into a drop down box using
    > HTML or javascript. [...]


    Try XMLHttpRequest. Note that this will prevent all customers with absent
    support for client-side scripting or XMLHttpRequest from ordering anything,
    so you definitely want to implement a server-side alternative for them.

    > THANK YOU!!!


    You're welcome. Please do no SHOUT.


    PointedEars
     
    Thomas 'PointedEars' Lahn, Dec 23, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    819
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,074
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    550
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    318
  5. Replies:
    3
    Views:
    323
Loading...

Share This Page