Thread: buttan onClick
View Single Post
Old 01-01-2013, 03:35 PM   PM User | #2
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,437
Thanks: 52
Thanked 454 Times in 452 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
if it's an entire form you are better off hiding it on page load and showing it when the button is pressed:

Code:
<!doctype html>
<html>
<head>
<style>
#myform{
display:none;
}
</style>
</head>
<body>
<input type="button" value="show form" onclick="showIt()"/>
<form id="myform">
<input/><br>
<input/>
</form>
<script>
function showIt(){
document.getElementById("myform").style.display="block";
}
</script>
</body>
</html>
xelawho is offline   Reply With Quote