HTML Forms
HTML - Buttons - Submit - Reset
What are HTML Forms
Web applications usually require users to provides some input. Typically a user fills out a form by filling out details with text and/or selecting from lists of options. HTML forms provide a mechanism for displaying input boxes (and buttons) that the user can use to provide input to a web application.
simple text fields code
<form> First name: <input name="firstname" type="text"> <br/> Last name: <input name="lastname" type="text"> </form> |
This is how it will appear in a browser |
View above example output in a new browser window |
simple select code
<form> <p>Select a fruit:</p> <select name="Fruit"> <option>Apples</option> <option>Bananas</option> <option>Oranges</option> </select> </form> |
This is how it will appear in a browser |
View above example output in a new browser window |
simple checkboxes
Used when you want the user to select one or more options
<form> <input type="checkbox" name="cat" value="cat"/> I like cats <br/> <input type="checkbox" name="dogs" value="dogs"/> I like dogs </form> |
This is how it will appear in a browser |
View above example output in a new browser window |
simple radio buttons code
<form> <input name="sex" type="radio" value="male"/> Male <br/> <input name="sex" type="radio" value="female"/> Female </form> |
This is how it will appear in a browser |
View above example output in a new browser window |
simple buttons submit, clear code
<form action="/actions/execute.aspx" method="get" name="input"> Username: <input name="username" type="text" /> <br /> <input type="submit" value="Submit" /> <input type="reset" value="Reset" /> </form> |
This is how it will appear in a browser |
View above example output in a new browser window |
simple textarea code
<form> <p>Please provide your suggestion in the text box below:</p> <textarea cols="30" rows="10"></textarea> </form> |
This is how it will appear in a browser |
View above example output in a new browser window |