Building a password field - AH163

Enter a password

The code display below used only <pre> and <code> and tabs for spacing.

		
<form action = "">
	<fieldset>
		<legend>Enter a password</legend>
		<p>
			<label>Type password here</label>
				<input type = "password"
						id = "pwd"
						value = "secret" />
		</p>
	</fieldset>
</form>
		
	

No ASCII replacement, only <pre> and <code> are used. No code is displayed, but the output. In HTML3.2 <xps> was used, but it was deprecated. I tried it and it worked very nicely. It did not require ASCII or other character replacement. IT IS TOO BAD!


Enter a password




Enter a password

The code below used <div>, <pre>, and <code> tags to get the display below.

		
<form action = "">
 <fieldset>
  <legend>Enter a password</legend>
  <p>
   <label>Type password here</label>
    <input type = "password"
      id = "pwd"
      value = "secret" />
   </p>
 </fieldset>
</form>
		
	

The above display of the code seems acceptable. I replaced only < and > with the appropriate ASCII codes, 60 and 62, respectively. I used one space for each indent. Note the example of the first code used tabs for each indent, and the output is weird.

The password field with the ID pwd . The default value of this field is secret . The term secret won't actually appear in the field; it will be replaced with six asterisk characters.