#1
  1. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Posts
    258
    Rep Power
    14

    Make Textbox visible based on drop down selection


    I'm not sure if this is a javascript question or not, but I am adding a module to a help desk and when a user selects a status of "Denied" from a drop down box, I would like to have another textbox either made visible or if it's greyed out make it ungreyed so that a description of why the work order is denied can be entered. At first I thought it would be cool to make the text box appear after the "denied" selection is made, but if the text box is sitting there greyed out then that is alright as well. Any ideas?

    Thanks in advance.
    "We're Gonna Need A Lot More Men." Davy Crockett
  2. #2
  3. Contributing User
    ASP Explorer (0 - 99 posts)

    Join Date
    Mar 2004
    Location
    NJ
    Posts
    60
    Rep Power
    37
    Originally Posted by dcampos
    I'm not sure if this is a javascript question or not, but I am adding a module to a help desk and when a user selects a status of "Denied" from a drop down box, I would like to have another textbox either made visible or if it's greyed out make it ungreyed so that a description of why the work order is denied can be entered. At first I thought it would be cool to make the text box appear after the "denied" selection is made, but if the text box is sitting there greyed out then that is alright as well. Any ideas?

    Thanks in advance.
    Here is a simple show hide you can use. The script is run with a link, but change it to onchange or something like that and add it to the drop down list and there you go.

    http://www.teamshibby.com/krstofer/Samples/showHide.asp


    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    
    <style type="text/css">
    .hideStu
    {
    visibility:hidden;position:absolute;
    }
    .showStu
    {
    visibility:visible;
    }
    </style>
    <script language="JavaScript">
    function showStuff(id, newClass) {
    
    identity=document.getElementById(id);
    
    identity.className=newClass;
    
    }
    </script>
    
    <a href="javascript:;" onClick="showStuff('changeme', 'showStu');">Show</a> | <a href="javascript:;" onClick="showStuff('changeme', 'hideStu');">Hide</a><br>
    
    <table id="changeme" class="hideStu" width="100%"  border="1" cellspacing="0" cellpadding="0">
      <tr> 
        <td>e</td>
        <td>e</td>
        <td>e</td>
        <td>e</td>
      </tr>
      <tr> 
        <td>&nbsp;</td>
        <td>e</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    test
    
    </body>
    </html>
    Check me out at M3FU.COM
  4. #3
  5. Contributing User
    ASP Discoverer (100 - 499 posts)

    Join Date
    Aug 2004
    Posts
    258
    Rep Power
    14
    Originally Posted by krstofer
    Here is a simple show hide you can use. The script is run with a link, but change it to onchange or something like that and add it to the drop down list and there you go.

    http://www.teamshibby.com/krstofer/Samples/showHide.asp


    Code:
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    
    <style type="text/css">
    .hideStu
    {
    visibility:hidden;position:absolute;
    }
    .showStu
    {
    visibility:visible;
    }
    </style>
    <script language="JavaScript">
    function showStuff(id, newClass) {
    
    identity=document.getElementById(id);
    
    identity.className=newClass;
    
    }
    </script>
    
    <a href="javascript:;" onClick="showStuff('changeme', 'showStu');">Show</a> | <a href="javascript:;" onClick="showStuff('changeme', 'hideStu');">Hide</a><br>
    
    <table id="changeme" class="hideStu" width="100%"  border="1" cellspacing="0" cellpadding="0">
      <tr> 
        <td>e</td>
        <td>e</td>
        <td>e</td>
        <td>e</td>
      </tr>
      <tr> 
        <td>&nbsp;</td>
        <td>e</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    test
    
    </body>
    </html>
    Thanks for the link. I'll see what I can do.

Similar Threads

  1. Displaying data based on combo box selection
    By Big Quinny in forum SQL Development
    Replies: 0
    Last Post: April 13th, 2005, 05:54 AM
  2. How to populate a textbox from a popup selection
    By roche786 in forum .NET Development
    Replies: 1
    Last Post: April 7th, 2005, 11:44 PM
  3. make visible
    By dtayl20 in forum Microsoft Access Help
    Replies: 1
    Last Post: March 5th, 2004, 09:19 AM
  4. create form based on selection in list box
    By adrenachrome26 in forum Microsoft Access Help
    Replies: 1
    Last Post: January 25th, 2004, 10:36 PM
  5. Replies: 1
    Last Post: October 24th, 2000, 06:09 AM

IMN logo majestic logo threadwatch logo seochat tools logo