Need a help about drop down lists - Bit Urgent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kashhere
    New Member
    • Feb 2008
    • 21

    Need a help about drop down lists - Bit Urgent

    Hi
    i am working on drop down list boxes.
    My main aim is to display a table if the option is selected in the list box
    i have kept the table as invisible
    please guide me towards the solution
    here goes the code




    [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitl ed Document</title>
    <script type="text/javascript">
    function change()
    {
    if(document.for ms[0].city.options.v alue=="vizag")
    {
    document.forms[0].list.style.dis play=true;
    }
    }
    </script>
    </head>

    <body>
    Films in City : <select name="city">
    <option value="" selected>Select a city</option>
    <option value="vizag" onClick="change ()">Vizag</option>
    </select>
    <table id="list" style="display: none; ">
    <tr>
    <td height="87">Par ugu</td>
    <td>Jagadamba </td>
    <td>Telugu</td>
    </tr>
    <tr>
    <td height="95">Jaa ne Tu Ya Jaane Na</td>
    <td>RamaDevi</td>
    <td>Hindi</td>
    </tr>
    <tr>
    <td height="163">Ha ncock</td>
    <td>Sarada</td>
    <td>English</td>
    </tr>
    </table>
    </body>
    </html>
    [/HTML]


    thanks in advance

    kash
    Last edited by gits; Jul 25 '08, 12:38 PM. Reason: added code tags
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Hello Kash, Here is your working code

    [HTML]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitl ed Document</title>
    <script type="text/javascript">
    function change()
    {
    var x = document.getEle mentById('mySel ect').selectedI ndex;
    if(x==1)
    document.getEle mentById('list' ).style.display = 'block';
    }
    function doThis()
    {
    document.getEle mentById('list' ).style.display = 'none';
    }
    </script>
    </head>

    <body onload="doThis( )">
    Films in City : <select name="city" id='mySelect' onChange="chang e()">
    <option value="" selected>Select a city</option>
    <option value="vizag">V izag</option>
    </select>

    <table id="list" border="1" cellspacing="3" cellpadding="3" >
    <tr>
    <td height="87">Par ugu</td>
    <td>Jagadamba </td>
    <td>Telugu</td>
    </tr>
    <tr>
    <td height="95">Jaa ne Tu Ya Jaane Na</td>
    <td>RamaDevi</td>
    <td>Hindi</td>
    </tr>
    <tr>
    <td height="163">Ha ncock</td>
    <td>Sarada</td>
    <td>English</td>
    </tr>
    </table>
    </body>
    </html>[/HTML]

    Enjoy

    Regards
    Ramanan Kalirajan

    Comment

    • kashhere
      New Member
      • Feb 2008
      • 21

      #3
      Thank you very much ramanan

      kash

      Comment

      • RamananKalirajan
        Contributor
        • Mar 2008
        • 608

        #4
        Originally posted by kashhere
        Thank you very much ramanan

        kash
        No Probs. If you need any help pls post it. I will help you out.

        Regards
        Ramanan Kalirajan

        Comment

        Working...