1. To clear the data there is an reset input type
<input type="reset">Clear</input>
To clear the echo message, set the
innerHtml
of the content to ""
But, validation should be done with client side, using javascipt/jquery/HTML5 validation. Not on server side.
See this[
^]
Good Luck!