Answers for "clear form after submit"

11

form reset jquery

$('#form_id').trigger("reset");
Posted by: Guest on June-26-2020
1

javascript clear form after dubmit

//Get form by Id 
var form = document.getElementById("MusicForm");
form.target.reset();
Posted by: Guest on November-15-2020
1

after submit how to clear form in js

$('#admin-package-add-form')[0].reset();
Posted by: Guest on July-12-2021
0

clear form value after submit

<div id="sidebar-info">
    <form name="contact-form" action="formprocess.php" method="post" target="ninja-frame">
        <h1>By Phone</h1>
        <p id="by-phone">XXX-XXX-XXXX</p>
        <h1>By Email</h1>
        <p id="form-row">Name</p>
        <input name="name" id="name" type="text" class="user-input" value="">
        <p id="form-row">Email</p>
        <input name="email" id="email" type="text" class="user-input" value="">
        <p id="form-row">Message</p>
        <textarea name="message" id="message" class="user-input" rows="10" maxlength="1500"></textarea>
        <p>*Please fill out every field</p>
        <input type="submit" value="Submit" id="submit" onclick="submitForm()">

        <script>
            function submitForm() {
            document.contact-form.submit();
            document.contact-form.reset();
            }
        </script>
    </form>
</div>
Posted by: Guest on July-06-2021

Code answers related to "clear form after submit"

Code answers related to "Javascript"

Browse Popular Code Answers by Language