Below you can find the demo and download of the demonstration.
DEMO | DOWNLOAD The validation formula we use here is simple. HTML Markup: <form name="my Form" action="#" method="post" onsubmit="validate()"> <ul><li> <label> Field No 1 </label><input type="text" name="field1" size="15"/></li> <li> <label> Field No 2 </label><input type="text" name="field2" size="15"/></li> </ul> <button type="submit" value="submit"> Submit</button> </form> The form above has something called as a onsubmit attribute in the form tag.
Copyright © 2008 The Extensible Markup Language (XML) is a subset of SGML that is completely described in this document.
Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML.
XML has been designed for ease of implementation and for interoperability with both SGML and HTML.
This section describes the status of this document at the time of its publication. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at
Have a look at the demo to see how it works, and compare the result of clicking the reset button and the button with the custom on Click handler that we have just coded. As the above demo illustrates, the two buttons function similarly, for this particular form, because none of the values of the elements in this form are set on page load.
When user finished writing the host in the tb Host. I intend to let user to have a choice to either click on button to display result or press enter key to display result.
Let us look at an example of a simple form As you can see, the first button simply resets all the fields using reset() as described earlier.