Category: HTML

Using HTML5 required field validation

HTML5 provides a built in functionality for required field validation. In the following code, both the user name and password are having a property set as required=”required”. When this property is set, the form will not submit unless the values are provided in the text boxes <form id="form1" name="form1" method="post" action=""> <table border="1"> <tr> <td>User

Grouping form elements using <fieldset> tag

Sometimes it is convenient to group various elements of a form. HTML providesĀ <fieldset></fieldset> tagsĀ for that purpose. Example Usage: <fieldset> <legend>Contact Details</legend> <table> <tr> <td>Email:</td> <td><input type="text" /></td> </tr> <tr> <td>Mobile:</td> <td><input type="text" /></td> </tr> <tr> <td>Telephone:</td> <td><input type="text" /></td> </tr> </table> </fieldset> Just copy and paste the above code in body tag where you want

Creating a Simple HTML form

When we create a form tag in HTML, we usually use four properties with the form id – This property represents a unique ID of the form tag. In a web document, we can have multiple forms, but each with a unique ID name – The name property contains the name of the form. The