Skip to content

Instantly share code, notes, and snippets.

@chiragmongia
Created August 10, 2013 08:52
Show Gist options
  • Select an option

  • Save chiragmongia/6199664 to your computer and use it in GitHub Desktop.

Select an option

Save chiragmongia/6199664 to your computer and use it in GitHub Desktop.
<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" name="text" size="36"></td>
</tr>
<tr>
<td>E-mail*:</td>
<td><input type="email" name="email" style="background-color: #FFEB99" size="36"></td>
</tr>
<tr>
<td>Phone number:</td>
<td><input type="text" name="number" style="background-color: #FFEB99" size="36"></td>
</tr>
<tr>
<td>Website*:</td>
<td><input type="url" name="website" placeholder="http://" size="50"></td>
</tr>
</table><br>
Comments*:<br>
<textarea rows="8" cols="35"></textarea><br><br>
<b>Textfield</b><br>
Your name:<input type="text" name="textfield" style="background-color: #FFEB99" size="36"><br><br>
<b>Password field</b><br>
Password:<input type="password" name="password" size="36"><br><br>
<b>Radio buttons</b><br>
Do you like pizza?<br>
<input type="radio" name="pizza" value="yes" checked>Yes<br>
<input type="radio" name="pizza" value="no">No<br>
<input type="radio" name="pizza" value="maybe">Maybe<br>
<input type="radio" name="pizza" value="never_tries">Never tried<br><br>
<b>Check Box</b><br>
<input type="checkbox" name="check">Check this box if you like our service<br><br>
<b>Text area</b><br>Anything you would like to say?<br>
<textarea rows="6" cols="47"></textarea><br><br>
<b>I Like</b><br><br>
<select multiple name="vegetables" size="5">
<option value="mushrooms">mushrooms</option>
<option value="green peppers">green peppers</option>
<option value="onions">onions</option>
<option value="tomatoes">tomatoes</option>
<option value="olives">olives</option>
</select><br><br>
<b>Menu</b><br>Your favorite color:<br>
<select name="color">
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
</select><br><br>
<b>Attach file</b><br>
<input type="file" 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