Skip to content

Instantly share code, notes, and snippets.

@chiragmongia
Created August 13, 2013 13:00
Show Gist options
  • Save chiragmongia/6220841 to your computer and use it in GitHub Desktop.
Save chiragmongia/6220841 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
</head>
<body bgcolor="#F2F2F2">
<h1 align="center">HTML form exercise</h1>
<p>
<font color="red">Please note:</font> This Example demonstrates how HTML forms can be used. Submit button should submit the button and reset button should reset the form(revert the changes in form fields). The form layout should be the same as below.
</p>
<b>Contact form</b>
<form action="default.htm" method="post">
<table>
<tr>
<td>Your name*:</td>
<td><input type="text" id="text" name="text" size="36"></td>
</tr>
<tr>
<td>E-mail*:</td>
<td><input type="email" id="email" name="email" style="background-color: #FFEB99" size="36"></td>
</tr>
<tr>
<td>Phone number:</td>
<td><input type="text" id="number" name="number" style="background-color: #FFEB99" size="36" maxlength="10"></td>
</tr>
<tr>
<td>Website*:</td>
<td><input type="url" id="website" name="website" placeholder="http://" size="50"></td>
</tr>
</table><br/>
Comments*:<br/>
<textarea rows="8" cols="35" id="comments" name="comments"></textarea><br/><br/>
<b>Textfield</b><br/>
Your name:<input type="text" id="textfield" name="textfield" style="background-color: #FFEB99" size="36"><br/><br/>
<b>Password field</b><br/>
Password:<input type="password" id="password" name="password" size="36"><br/><br/>
<b>Radio buttons</b><br/>
Do you like pizza?<br/>
<input type="radio" name="pizza" id="yes" value="yes" checked>
<label for="yes">Yes</label><br/>
<input type="radio" name="pizza" id="no" value="no">
<label for="no">No</label><br/>
<input type="radio" name="pizza" id="maybe" value="maybe">
<label for="maybe">Maybe</label><br/>
<input type="radio" name="pizza" id="never_tried" value="never_tried">
<label for="never_tried">Never tried</label><br/><br/>
<b>Check Box</b><br/>
<input type="checkbox" id="check" name="check">
<label for="check">Check this box if you like our service</label><br/><br/>
<b>Text area</b><br/>Anything you would like to say?<br/>
<textarea rows="6" cols="47" id="suggestion" name="suggestion"></textarea><br/><br/>
<b>I Like</b><br/><br/>
<select multiple name="vegetables" size="5">
<option id="mushrooms" value="mushrooms">mushrooms</option>
<option id="green_peppers" value="green peppers">green peppers</option>
<option id="onions" value="onions">onions</option>
<option id="tomatoes" value="tomatoes">tomatoes</option>
<option id="olives" value="olives">olives</option>
</select><br/><br/>
<b>Menu</b><br/>Your favorite color:<br/>
<select name="color">
<option id="red" value="red">red</option>
<option id="blue" value="blue">blue</option>
<option id="green" value="green">green</option>
</select><br/><br/>
<b>Attach file</b><br/>
<input type="file" id="attachment" name="attachment"><br/><br/>
<b>Buttons</b><br/>
<input type="submit" name="Submit">
<input type="reset" name="Reset">
</form>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment