Search
 
SCRIPT & CODE EXAMPLE
 

HTML

html clear input after submit

use: document.getElementById("myForm").reset();
Comment

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>
Comment

after submit how to clear form in js

$('#admin-package-add-form')[0].reset();
Comment

PREVIOUS NEXT
Code Example
Html :: What is the correct HTML element for playing audio files? 
Html :: html signature 
Html :: base64 image in html 
Html :: text monospace bootstrap 
Html :: select input placeholder 
Html :: html code contact form template 
Html :: link open in new tab html 
Html :: h1 
Html :: slick html 
Html :: how to escape in html 
Html :: html input box integer only 
Html :: laravel raw html 
Html :: row merging in html 
Html :: bootstrap dropdown with checkbox 
Html :: breaks html 
Html :: underline text in html 
Html :: on button click video popup in html 
Html :: html css text style on a word 
Html :: block level elements 
Html :: range html 
Html :: span html 
Html :: rounded pill bootstrap 5 
Html :: li html 
Html :: img srcset 
Html :: Scrollable Text in HTML 
Html :: html tags 
Html :: how to convert html to text in angular 
Html :: how to add text box html 
Html :: multiple checkbox in one line bootstrap 
Html :: tailwind rounded top left 
ADD CONTENT
Topic
Content
Source link
Name
5+2 =