Click to See Complete Forum and Search --> : dynamic listbox
hugsdan
May 12th, 2003, 05:45 AM
hi all,
ihave a jsp page with two frames,
in the first, i have a listbox, and i want to display in the second frame a tab which depends on the result of the listbox whitout clicking on a button, how can i do?
Satishpp
May 12th, 2003, 06:07 PM
I dont know JSP, but in pure HTML and Javascript this is how it would be implemented. The same should be true for your case as the problem is a client side one...
This is what the code for the first frame (lets call it the left hand side frame) should look like.
----------------------
<html>
<head>
<script>
function ftest()
{
document.frmtest.submit();
}
</script>
</head>
<body>
<form name=frmtest action=frameright1.html target=RHS>
<select name="stest" size="2" onchange=ftest()>
<option selected>first value</option>
<option>second value</option>
</select>
</form>
</body>
</html>
----------------------
Onchange of the list box, the form is submitted. Normally the form would be submited and the URL specified in the action for the form would be shown in the same frame, but we can direct it to another frame or window by specifying the Form's Target attribute.
Here RHS is the name of the Right hand side frame...
Satish
codeguru.com
Copyright Internet.com Inc., All Rights Reserved.