HTML and CSS Reference
In-Depth Information
…
<p><label>Age: <input type="number" name="age" min="0"
max="150" /></label></p>
</fieldset>
Next, a required color picker input is used as a simple check against automated spam
bots, which presumably wouldn't be able to pick the correct color for “snow.” Sadly, the
pattern
attribute isn't available on the
color
input type, so this would need to be
checked with JavaScript on the server side. We'll assume it's being checked on the serv-
er:
…
<p><label>Spam check. What color is snow? (choose a
color)
<input
type="color"
name="captcha"
re-
quired/></label></p>
…
Lastly, a submit button is added just before the closing
form
tag, which completes
this form:
…
<button type="submit" name="tipform1">Submit</button>
</form>
Page 2, gathering commentary
After filling in the form and clicking submit, the user ends up on page 2 with the second
form, which looks like
Figure 4-31
.
Search WWH ::
Custom Search