+ 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!
4 Answers
+ 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.