-
Notifications
You must be signed in to change notification settings - Fork 0
/
example_required.html
executable file
·57 lines (45 loc) · 1.19 KB
/
example_required.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
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script src="jsf.js"></script>
<script>
$(document).ready(function() {
$("form").jsf({
selectInput: function(elt) { return elt.parent() }
});
});
</script>
<link href="example.css" rel="stylesheet">
</head>
<body>
<form>
<div>
<label>Gender</label>
<select name="gender"
jsf:required="true"
>
<option value="">-</option>
<option value="m">Male</option>
<option value="f">Female</option>
</select>
</div>
<div>
<label>I like soccer</label>
<div class="help">Required if gender is Male</div>
<input type="checkbox" name="soccer"
jsf:required="gender == 'm'"
/>
</div>
<div>
<label>Favorite pet</label>
<input type="radio" name="pet"
jsf:required="1"
/>Cat
<input type="radio" name="pet"
jsf:required="1"
/>Dog
</div>
<input type="submit" value="ok" />
</form>
</body>
</html>