-
Notifications
You must be signed in to change notification settings - Fork 64
/
errorMessageStyling.html
125 lines (95 loc) · 3.15 KB
/
errorMessageStyling.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link type="text/css" rel="stylesheet" href="css/form.css" />
<style type="text/css">
<!--
/*
* Styling the "Full Name" error message.
*/
/*
* The background color of the main box
*/
/* Webkit */
input[name="fullName"]::-webkit-validation-bubble-message {
color: green !important;
background: white;
border: 1px solid black;
padding: 18px;
}
input[name="fullName"]::-webkit-validation-bubble-icon {
display: none;
}
/* Polyfill */
#fullName_wf2_errorMsg {
color: green !important;
background: white;
}
/* Needed for IE to get rid of gradient background, or to replace it with another gradient */
#fullName_wf2_errorMsg .wf2_errorMsgContainer {
filter: none !important;
}
/*
* Step 2: The arrow
*/
[name="fullName"]::-webkit-validation-bubble-arrow {
background: white;
border: solid black 1px;
}
/* Polyfill */
#fullName_wf2_errorMsg:before {
/* By default, the image is 29x15, but you can change it and position it with CSS */
background: url('images/whiteValidationPointer.png');
}
#companyName_wf2_errorMsg {
color: yellow !important;
}
-->
</style>
<script type="text/javascript" src="../../shared/js/modernizr.com/Modernizr-2.5.3.forms.js">
</script>
<!-- Needed for Validation -->
<script type="text/javascript" src="../../shared/js/html5Forms.js" data-webforms2-support="validation" data-webforms2-force-js-validation="true">
</script>
<title>HTML5 placeholder Attribute Test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
</head>
<body id="myExample">
<div id="exampleBlurb">
<p>
This is an example of a HTML5 form which has a different error message style for each of its form elements.
<a href="http://www.useragentman.com/blog/?p=4472">Back to User Agent Man HTML5 Forms article </a>
</p>
</div>
<form action="http://www.useragentman.com/testForm.php" data-webforms2-force-js-validation="true" >
<fieldset>
<legend>Personal Information</legend>
<p>It is important you fill out <strong>all</strong> of the information in this form.</p>
<table class="formTable">
<tr>
<th>Full Name :</th>
<td><input type="text" name="fullName" value="" required="required" placeholder="Required information"
oninvalid="this.setCustomValidity('Yo, Bro! You forgot to fill out this field!')"
onkeydown="this.setCustomValidity('')"/>
<div class="description"></div>
</td>
</tr>
<tr>
<th>Company Name :</th>
<td><input type="text" name="companyName" required="required" value=""
oninvalid="this.setCustomValidity('Don\'t forget this field either, Holmes!')"
onkeydown="this.setCustomValidity('')"
/>
<div class="description"></div>
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit Information"/></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>