...

View Full Version : Hiding a control in JavaScript in pagelode



chakravarthy_vc
03-21-2005, 09:19 AM
Hi,

I have two DropDownList boxes and one button in my page, I want to disply ListBoxes whenever I click the button. I want to hide these controls when the page is loading. How to do this.

Regards,
Chakravarthy.v

glenngv
03-21-2005, 01:44 PM
<html>
<head>
<script type="text/javascript">
function showListBoxes(){
document.getElementById('list1').style.display='inline';
document.getElementById('list2').style.display='inline';
}
</script>
</head>
<body>
<form>
<select name="list1" id="list1" style="display:none">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<select name="list2" id="list2" style="display:none">
<option>1</option>
<option>2</option>
<option>3</option>
</select>
<input type="button" value="Show" onclick="showListBoxes()" />
</form>
</body>
</html>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum