HTML Select statement option list

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Steve Wright

    HTML Select statement option list

    Hi all,
    I suspect that I will need Javascript to make this work which is why I am
    asking the question here! (and also crossposting)

    Can someone tell me if it is possible to have an HTML select statement that
    gets its options from a text file.

    <select name="contract" >
    <option value="">Select Contract</option> |
    <option value="RS-330">RS-330 Northern</option> | these
    bits should come fron an external file
    <option value="RS-331">RS-331 Southern</option> |
    </select></td>

    Clear??

    Steve




  • Toby A Inkster

    #2
    Re: HTML Select statement option list

    Steve Wright wrote:
    [color=blue]
    > I suspect that I will need Javascript to make this work which is why I am
    > asking the question here! (and also crossposting)
    >
    > Can someone tell me if it is possible to have an HTML select statement that
    > gets its options from a text file.[/color]

    Yes it is, but Javascript is probably not the best way to do it. Try
    comp.lang.perl or comp.lang.php.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132

    Comment

    • David Dorward

      #3
      Re: HTML Select statement option list

      Steve Wright wrote:
      [color=blue]
      > Can someone tell me if it is possible to have an HTML select statement
      > that gets its options from a text file.[/color]

      While you might be able to populate it using JavaScript and httpxml, doing
      so will be unreliable and only work in some instances of MSIE and Mozilla
      (and you'll need different techniques for each of them).

      You would be much better of generating it using some server side tool. If
      you are using forms then you should have the capability to run such a tool
      already. The specifics depend on the server platform.

      --
      David Dorward <http://blog.dorward.me .uk/> <http://dorward.me.uk/>

      Comment

      Working...