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

+12

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

_F1_

4 Answers

New Answer

+9

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.

+12

naomi Thank you! It worked!

+12

i also tried it and it works thanks alot

+5

Thanks Naomi for the help.