Difference between revisions of "Forms"

From MyWiki
Jump to: navigation, search
 
(7 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
</source>
 
</source>
 
Also note that the default width of a text field is 20 characters.<br>
 
Also note that the default width of a text field is 20 characters.<br>
 +
<source lang="html4strict">
 +
<form>
 +
Password: <input type="password" name="pwd">
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form>
 +
<input type="radio" name="sex" value="male">Male<br>
 +
<input type="radio" name="sex" value="female">Female
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form>
 +
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
 +
<input type="checkbox" name="vehicle" value="Car">I have a car
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form name="input" action="demo_form_action.asp" method="get">
 +
Username: <input type="text" name="user">
 +
<input type="submit" value="Submit">
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form action="">
 +
<select name="cars">
 +
<option value="volvo">Volvo</option>
 +
<option value="saab">Saab</option>
 +
<option value="fiat">Fiat</option>
 +
<option value="audi">Audi</option>
 +
</select>
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form action="">
 +
<select name="cars">
 +
<option value="volvo">Volvo</option>
 +
<option value="saab">Saab</option>
 +
<option value="fiat" selected>Fiat</option>
 +
<option value="audi">Audi</option>
 +
</select>
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form action="">
 +
<input type="button" value="Hello world!">
 +
</form>
 +
</source>
 +
<source lang="html4strict">
 +
<form action="">
 +
<fieldset>
 +
<legend>Personal information:</legend>
 +
Name: <input type="text" size="30"><br>
 +
E-mail: <input type="text" size="30"><br>
 +
Date of birth: <input type="text" size="10">
 +
</fieldset>
 +
</form>
 +
</source>

Latest revision as of 16:47, 12 June 2014

http://www.w3schools.com/html/html_forms.asp

 Text Fields
 <input type="text"> defines a one-line input field that a user can enter text into:
 <form>
 First name: <input type="text" name="firstname"><br>
  Last name: <input type="text" name="lastname">
 </form>

Also note that the default width of a text field is 20 characters.

<form>
Password: <input type="password" name="pwd">
</form>
<form>
<input type="radio" name="sex" value="male">Male<br>
<input type="radio" name="sex" value="female">Female
</form>
<form>
<input type="checkbox" name="vehicle" value="Bike">I have a bike<br>
<input type="checkbox" name="vehicle" value="Car">I have a car
</form>
<form name="input" action="demo_form_action.asp" method="get">
Username: <input type="text" name="user">
<input type="submit" value="Submit">
</form>
<form action="">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat">Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
<form action="">
<select name="cars">
<option value="volvo">Volvo</option>
<option value="saab">Saab</option>
<option value="fiat" selected>Fiat</option>
<option value="audi">Audi</option>
</select>
</form>
<form action="">
<input type="button" value="Hello world!">
</form>
<form action="">
<fieldset>
<legend>Personal information:</legend>
Name: <input type="text" size="30"><br>
E-mail: <input type="text" size="30"><br>
Date of birth: <input type="text" size="10">
</fieldset>
</form>