Results 1 to 10 of 10

Thread: Need litle help in about form element

  1. #1
    Join Date
    May 2007
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default Need litle help in about form element

    I am newbie to html forms elements. can someone please tell me how do I make <select /> option in a way when a user select product A, another question related to this product appears.

    please see this form. When you select a product, another section related to this product appear

    thanks

  2. #2
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    Like this script? Dynamic Drive offers a lot of great scripts, including form effects. Check them out
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  3. #3
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    ..or like this
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
       "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script type="text/javascript">
    function change()
    {
       switch (document.getElementById("select").value)
       {
          case "1":
          document.getElementById("change").innerHTML = "Option 1 has changed this DIV tag's content"
          break;
          case "2":
          document.getElementById("change").innerHTML = "<font color='#ff0000'>Option 2 has changed this DIV tag's content</font>"
          break;
          case "3":
          document.getElementById("change").innerHTML = "<font color='#0000ff'>Option 3 has changed this DIV tag's content"
          break;
       }
    }
    </script>
    </head>
    <body>
    <select onchange="change()" id="select">
    	<option value="">Feel Free to choose</option>
       <option value="1">Option 1</option>
       <option value="2">Option 2</option>
       <option value="3">Option 3</option>
    </select>
    <div id="change" style="display:inline;margin:10px;border:1px solid #999;">
       Original Text
    </div>
    </body>
    </html>
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  4. The Following User Says Thank You to rangana For This Useful Post:

    sakib000 (02-26-2008)

  5. #4
    Join Date
    May 2007
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    thanks to both, rangana did exactly. thanks again

  6. #5
    Join Date
    Feb 2008
    Location
    Cebu City Philippines
    Posts
    1,160
    Thanks
    17
    Thanked 277 Times in 275 Posts

    Default

    NO problem...you're welcome.
    Learn how to code at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph!

  7. #6
    Join Date
    May 2007
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    rangana,
    how can i put any html inside
    .innerHTML = "here"

    I am trying to put
    <select id="extrapages" class="dropdown" name="additionalsilver">
    <option>1 +$65.95</option>
    <option>2 +$131.90</option>
    <option>3 +$197.40</option>
    <option>4 +$263.35</option>
    </select>


    and its not working

  8. #7
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Code:
    document.getElementById("change").innerHTML = "<select id='extrapages' class='dropdown' name='additionalsilver'>";
    document.getElementById("change").innerHTML += "<option>1 +$65.95</option>";
    document.getElementById("change").innerHTML += "<option>2 +$131.90</option>";
    document.getElementById("change").innerHTML += "<option>3 +$197.40</option>";
    document.getElementById("change").innerHTML += "<option>4 +$263.35</option>";
    document.getElementById("change").innerHTML += "</select>";
    Hope this helps.
    Last edited by thetestingsite; 02-27-2008 at 01:41 AM.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  9. The Following User Says Thank You to thetestingsite For This Useful Post:

    sakib000 (02-26-2008)

  10. #8
    Join Date
    May 2007
    Posts
    9
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Default

    and its not working ^

  11. #9
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    change

    Quote Originally Posted by thetestingsite View Post
    Code:
    document.getElementById("change").innerHTML = "<select id='extrapages' class="dropdown" name='additionalsilver'>";

    to
    Code:
    document.getElementById("change").innerHTML = "<select id='extrapages' class='dropdown' name='additionalsilver'>";
    he had an extra set of double quotes, thus ending the string pre-maturely

  12. #10
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Quote Originally Posted by boogyman View Post
    change to
    Code:
    document.getElementById("change").innerHTML = "<select id='extrapages' class='dropdown' name='additionalsilver'>";
    he had an extra set of double quotes, thus ending the string pre-maturely
    Oops, missed that one. Thanks for noticing.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  13. The Following User Says Thank You to thetestingsite For This Useful Post:

    sakib000 (02-28-2008)

Bookmarks

Posting Permissions

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