Question about forms | Sololearn: Learn to code for FREE!


Question about forms

In one of my new codes is a form. I need to make the input boxes empty after they are filled in and the form is submitted. How can I do that? I have tried a couple things, but they all don’t work. Please help me!

7/11/2018 2:48:26 PM


4 Answers

New Answer


If you're using HTML and JavaScript, the form has a reset method. function onSubmit() { document.getElementById("myForm").reset(); } Else create a function that sets the text of each field to an empty string.


naomi Thank you! It worked!


i also tried it and it works thanks alot


Thanks Naomi for the help.