forked from muicss/mui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtextfield.html
More file actions
129 lines (121 loc) · 4.33 KB
/
textfield.html
File metadata and controls
129 lines (121 loc) · 4.33 KB
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
126
127
128
129
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="../assets/mui/css/mui.css"/>
<script src="../assets/css-switch.js"></script>
<script>
window.addEventListener('load', function() {
var s = document.createElement('script');
s.src = "../assets/mui/js/mui.js";
document.head.appendChild(s);
var el = document.getElementsByTagName('select')[0];
el.onchange = function() {
console.log('select onchange');
};
el.addEventListener('change', function() {
console.log('select change');
});
});
</script>
</head>
<body>
<div class="mui-container">
<h2>Inputs and Textareas</h2>
<div class="mui-panel">
<h3>Form with placeholders</h3>
<form>
<div class="mui-textfield">
<input type="text" placeholder="Placeholder 1">
</div>
<div class="mui-textfield">
<input type="text" placeholder="Placeholder 2">
</div>
<button type="submit" class="mui-btn mui-btn--raised">Submit</button>
</form>
<h3>Form with fixed labels</h3>
<form>
<div class="mui-textfield">
<input type="text">
<label>Input 1</label>
</div>
<div class="mui-textfield">
<input type="text">
<label>Input 2</label>
</div>
<div class="mui-textfield">
<textarea></textarea>
<label>Textarea</label>
</div>
<button type="submit" class="mui-btn mui-btn--raised">Submit</button>
</form>
<h3>Form with floating labels</h3>
<form>
<div class="mui-textfield mui-textfield--float-label">
<input type="text" autofocus>
<label>Auto focused</label>
</div>
<div class="mui-textfield mui-textfield--float-label">
<input type="text">
<label>Placeholder</label>
</div>
<div class="mui-textfield mui-textfield--float-label">
<input type="text" value="Value on load">
<label>Placeholder</label>
</div>
<div class="mui-textfield mui-textfield--float-label">
<textarea>Value on load</textarea>
<label>Placeholder</label>
</div>
<button type="submit" class="mui-btn mui-btn--raised">Submit</button>
</form>
<h3>Label overflow</h3>
<form>
<div class="mui-textfield mui-textfield--wrap-label">
<input type="text">
<label>Very long long long long long long label</label>
</div>
<div class="mui-textfield">
<input type="text">
<label>Very long long long long long long label</label>
</div>
<div class="mui-textfield mui-textfield--float-label">
<input type="text">
<label>Very long long long long long long label</label>
</div>
</form>
</div>
<h2>Form Validation</h2>
<div class="mui-panel">
<form>
<div class="mui-textfield">
<input type="email">
<label>Email address (should turn red on invalid input)</label>
</div>
<div class="mui-textfield">
<input type="email" value="err">
<label>Email address (should be red on load)</label>
</div>
<div class="mui-textfield">
<input type="email" required>
<label>Required email address (should turn red after focus or invalid input)</label>
</div>
<div class="mui-textfield">
<input type="text" required>
<label>Required text (should turn red after focus)</label>
</div>
<div class="mui-textfield">
<input type="text" value="val" required>
<label>Required text (should turn red after deletion)</label>
</div>
<div class="mui-textfield">
<input type="text" value="val" class="mui--is-invalid">
<label>mui--is-invalid (should be red on load)</label>
</div>
</form>
</div>
</div>
</body>
</html>