Hello.
I have a form in my website that I want to hide at page load. But after the page load, there remains empty space. The form is inside the table. So, I tried resizing table with following code. But its not working.

<script type="text/javascript">
		function HideForm()
			{
				document.getElementById('emf-form').style.visibility='hidden';
				document.getElementById('page2').style.height='200px';
				
			}
	</script>

Recommended Answers

All 2 Replies

To hide an element without it still taking up the physical space on the page you need to use the property for display not for visibility. Visibility will leave elements in the flow of the document where display:none will remove it from the flow.

document.getElementById('emf-form').style.display='none';
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.