An HTML test form 

Joined:
02/21/2009
Posts:
151

April 07, 2009 03:29:45    Last update: January 11, 2011 20:04:31
This is a test HTML form with almost all kinds of input types.

It is weird that both IE and Firefox list the fieldset in the forms[0].elements array as an element with undefined name, type and value.

  • Code
  • Demo
<html>
	<body>
		<form name="MyTestForm">
			<fieldset>
			<label for="fname">First Name: </label><input type="text" name="firstName" id="fname"><br/>
			<label for="lname">Last Name: </label><input type="text" name="lastName" id="lname"><br/>
			EMail: <input type="text" name="email"><br/>
			Password: <input type="password" name="password"><br/>
			Gender: <input type="radio" name="gender" value="male"/>&nbsp;
					<input type="radio"	name="gender" value="female"/><br/>
			Reminder: <input type="checkbox" name="checkbox" value="Y"/><br/>
			Select: <select name="selectOne">
				<option value="1">Option 1</option>
				<option value="2">Option 2</option>
				<option value="3">Option 3</option>
				<option value="4">Option 4</option>
				<option value="5">Option 5</option>
			</select><br/>
			Select Multiple: <select name="selectMultiple" multiple>
				<option value="1">Opt One</option>
				<option value="2">Opt Two</option>
				<option value="3">Opt Three</option>
				<option value="4">Opt Four</option>
				<option value="5">Opt Five</option>
			</select><br/>
			</fieldset>

		<fieldset>
		Com OS: <SELECT name="ComOS">
			<OPTION selected label="none" value="none">None</OPTION>
			<OPTGROUP label="PortMaster 3">
				<OPTION label="3.7.1" value="pm3_3.7.1">PortMaster 3 with ComOS 3.7.1</OPTION>
				<OPTION label="3.7" value="pm3_3.7">PortMaster 3 with ComOS 3.7</OPTION>
				<OPTION label="3.5" value="pm3_3.5">PortMaster 3 with ComOS 3.5</OPTION>
			</OPTGROUP>
			<OPTGROUP label="PortMaster 2">
				<OPTION label="3.7" value="pm2_3.7">PortMaster 2 with ComOS 3.7</OPTION>
				<OPTION label="3.5" value="pm2_3.5">PortMaster 2 with ComOS 3.5</OPTION>
			</OPTGROUP>
			<OPTGROUP label="IRX">
				<OPTION label="3.7R" value="IRX_3.7R">IRX with ComOS 3.7R</OPTION>
				<OPTION label="3.5R" value="IRX_3.5R">IRX with ComOS 3.5R</OPTION>
			</OPTGROUP>
		</SELECT><br/>
			
			Text: <textarea name="textArea" cols="36" rows="5"></textarea><br/>
		</fieldset>

		<fieldset>
			<input type="hidden" name="hiddenInput"/>
			<input type="button" name="button1" value="A Button"/><br/> 
			<button name="button2" value="Normal Button">Normal Button</button><br/>
			<button name="button3" value="Submit Button" type="submit">Submit Button</button><br/>
			<button name="button4" value="Reset Button" type="reset">Reset Button</button><br/>
			<input type="image" name="imageInput" src="google_reader.jpg" value="imageValue"/><br/>
			Upload File: <input type="file" name="fileInput"/><br/>
			<input type="reset" name="reset" value="Reset"/>&nbsp;
			<input type="submit" name="submit" value="Submit"/><br/>
		</fieldset>
		</form>
	</body>
</html>
Share |
| Comment  | Tags