1

I have a form and I want it to not be displayed on submit - how is this possible? :)

<body>
<form method="POST" action="test.php" name="_navn">
<input name="txt" id="input" type="text" value="Write here" onFocus="noValue()" onBlur="changeValue()">
<input type="submit" value="Submit">
<input type="hidden" name="_submit_check" value="1">
</form>
</body>

This is what I want to go away when the hidden input is submitted. How? :)
(the <body>-tags are not part of what I want to be deleted hehe)

1 Answer 1

3

you just want the form and everything in it off the page?

var f = document.getElementsByTagName('form')[0];
f.parentNode.removeChild(f);

otherwise you can just hide it with

f.style.visibility = 'hidden'

or

f.style.display = 'none';
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.