Skip to content

Instantly share code, notes, and snippets.

@chiragmongia
Created February 20, 2013 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chiragmongia/4993602 to your computer and use it in GitHub Desktop.
Save chiragmongia/4993602 to your computer and use it in GitHub Desktop.
<html>
<body bgcolor="#F0F8FF">
<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.<br>
<form action="MAILTO:chiragmongia05@gmail.com" method="post;">
<b>Contact form</b><br>
<table>
<tr><td align="left">Your Name*:</td>
<td align="left"><input type="text" name="yourname"/>
</td></tr>
<tr>
<td align="left">E-mail*:</td>
<td align="left"><input type="text@text.text.text" style="background-color:#FFFF99;" name="email"/>
</td></tr>
<tr>
<td align="left">Phone number:</td>
<td align="left"><input type="text" style="background-color:#FFFF99;" name="phone" />
</td></tr>
<tr>
<td align="left">Website:</td>
<td align="left"><input type="url" name="website" value="http://" />
</td></tr>
</table>
Comments*:<br>
<textarea rows="5" cols="50"></textarea><br>
<br>
<b>Textfield</b><br>
Your name: <input type="text"style="background-color:#FFFF99;" name="yourname"><br><br>
<b>Password field</b><br>
Password: <input type="password" name="pass"><br><br>
<b>Radio Buttons</b><br>
Do you like pizza?<br>
<input type="radio" name="options" value="yes" checked="true">Yes<br>
<input type="radio" name="options" value="no">No<br>
<input type="radio" name="options" value="maybe">Maybe<br>
<input type="radio" name="options" value="nevertried">Never tried<br><br>
<b>Check Box</b><br>
<input type="checkbox" name="check" value="checking">Check this box if you like our service<br><br>
<b>Text area</b><br>
Anything you would like to say?<br>
<textarea rows="5" cols="50"></textarea><br><br>
<b>I like</b><br><br>
<select size="5">
<option>mushrooms
<option>green peppers
<option>onions
<option>tomatoes
<option>olives
</select><br><br>
<b>Menu</b><br><br>
Your favourite color:<br>
<select>
<option value="red">red</option>
<option value="blue">blue</option>
<option value="green">green</option>
<option value="yellow">yellow</option>
<option value="orange">orange</option>
</select><br><br>
<b>Attach file</b><br>
<input type="file" name="file"><br><br>
<b>Buttons</b><br>
<input type="submit" onClick ="alert('Form submitted successfully!')" value="Submit">
<input type="reset" value="Reset">
</form>
</body>
</html>
@eshamukherjee08
Copy link

Review points-

1.Please use 2 spaces instead of tabs to indent the text.(or set tab = 2 spaces in editor)
2.Comment Textarea should have 8 ROWS and 35 COLUMNS approx so as to match the design image.
3.Size of all input elements should have been 36 approx.
4.Size of Website input elements should have been 50 approx.
5.'Anythig you would like to say?' Textarea should have 6 ROWS and 47 COLUMNS approx so as to match the design image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment