Need help with a dropdown menu in a form

Discussion in 'JavaScript' started by Tibiacity, May 20, 2008.

  1. #1
    I have the next form:

    
    <label for=type>Type:</label>   <select id=type name="type" size=1>
          <option value="draft">Draft</option>
          <option value="news">Newspost</option>
          <option value="article">Article</option>
          <option value="guide">Guide</option>
          <option value="promotion">Blog entry</option>
          <option value="interview">Interview</option>
          <option value="story">Story</option>
          <option value="webpage">Webpage</option>
          <option value="manual">Manual</option>
          <option value="staffmanual">Staff manual</option>
          <option value="newsticker">Newsticker</option>
          </select><br>
    HTML:

    When the user selects newspost I want the next to appear:

    <label for=cat>Category:</label>  <input type=text id=cat name="category"> Only for newsposts.<br>
    HTML:

    When they select article, guide, promotion or interview I want this to show:

    <label for=img>Image id:</label>  <input type=text id=img name="image"> 150x50! For guides & articles. - <a href="imagemanager.php?c=catpic" target="_blank">Browse...</a><br>
    HTML:

    If they select something else nothing must appear. Anyone has any sugestions?
     
    Tibiacity, May 20, 2008 IP