#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    9
    Rep Power
    0

    Unhappy JSP Combo boxes and tables


    Hi there everybody,

    I need help quickly, Because this is for my final year project. This is the problem that I have got:

    I have a combo box written in JSP and I want a table to be displayed below the combo box when a user clicks on an item in the list. Please can somebody send a code example for me to try as it is getting desparate now,

    Many Thanks,

    Maytrix (on the edge)
  2. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    Are you saying you want a user to pick a selection out of a drop down and then have the table show without resubmitting the page?

    If so, then this is a javascript/html question. You can use the cascading style display. Give the table an id and then you can manipulate the style of this table in javascript.
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    
    <html>
    <head>
    	<title>Untitled</title>
    <script>
    	function changeDisplay(displayTable) {
    		var value = (displayTable ? "block" : "none");
    		var t = document.getElementById("table1");
    		t.style.display = value;
    	}
    </script>
    </head>
    
    <body>
    <select onchange="changeDisplay(true);">
    	<option></option>
    	<option>something</option>
    </select>
    <table id=table1 style="display:none">
    	<tr>
    		<td>
    			Some stuff
    		</td>
    	</tr>
    </table>
    
    
    </body>
    </html>
    For more details you may want to check in the javascript/html forum.

IMN logo majestic logo threadwatch logo seochat tools logo