Use the following code snippet to hide the form when the button is clicked.
document.getElementById("your form id").style.display="none";
And the following code to display it:
document.getElementById("your form id").style.display="block";
Or you can use the same function for both purposes:
function asd(a) { if(a==1) document.getElementById("asd").style.display="none"; else document.getElementById("asd").style.display="block"; }
And HTML:
<form id="asd">form </form> <button onclick="asd(1)">Hide</button> <button onclick="asd(2)">Show</button>
source share