-2
echo "<script type='text/javascript'>alert('Success!');history.go(-1);</script>";

I'm using this to display Success and go back to form after submit the form. But I want to extend this code to clear input fields too. How should I do this? Thank You!

Isuru
  • 3
  • 1
  • 5

1 Answers1

0

you need to call

document.getElementById('formId').reset();
Mahdi Younesi
  • 5,930
  • 1
  • 19
  • 47