I would like to hide a form within a button. Hiding the form is done but the problem is that the hidden forms area size is displayed as an empty area under my box so I have a big space between the bottom of the button and content below the button e.g. another button.
Button Code
<button class="myButtonl" onclick='showForm();'>Create a Player</button>
Form Code
<div id="div1" style="visibility:hidden;">
<form action="team.php" method="POST" name="profiles">
<div>Team Name: <input type="text" name="psn" value=""></div>
<input type="submit">
</form>
</div>
Javascript
<script>
function showForm() {
document.getElementById('div1').style.visibility= 'visible' ;
}
</script>
I guess the effect i am looking for is that the button holds the form inside of it until the button has been clicked and then the form drops down to be displayed below it. Also if it is possible that if the button is clicked again while the form is showing that the form is put back inside of the button so it is not visible any more until it is clicked again.