dynamic form drop down list from text field

Discussion in 'JavaScript' started by alfman05302001, Jul 13, 2008.

  1. #1
    This is probably fairly common but I never could quite understand JS code (more of a PHP guy)

    My problem:

    I want to have a form where a number is entered into a text field (<input type="text">)

    Based on that number a drop down list options are generated (<select><option>)

    If the number is 0 then the only option in the drop down is 0
    if the number is between 1 and 50 inclusive the options are 0 or 1
    if 51 or greater the options are 0, 1, 2

    Thanks
     
    alfman05302001, Jul 13, 2008 IP
  2. seo8k

    seo8k Guest

    Messages:
    70
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I can give you some prompt
    1. You can opeate your Inputbox and Select like this:
    document.getelementbyid("yourinputbox").parameter
    2. You need to create a JS function.
    3. You need to add some HTML event in your "Select", such as "onchange()"
    If you still don't know how to do, you can PM me
     
    seo8k, Jul 13, 2008 IP