-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
69 lines (69 loc) · 2.7 KB
/
Copy pathindex.html
File metadata and controls
69 lines (69 loc) · 2.7 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
<!DOCTYPE HTML>
<html lang="ja-JP">
<head>
<meta charset="UTF-8" />
<title></title>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.getformvalue.js"></script>
<script type="text/javascript">
$(function() {
$('form').submit(function(e) {
e.preventDefault();
var data = $(this).getFormValue();
console.log(data);
});
});
</script>
</head>
<body>
<h1>Get Form Value</h1>
<p>適当な値を入れて、ボタンを押してね。</p>
<form id="sampleForm">
<dl>
<dt>Text</dt>
<dd><input type="text" name="text" value="" /></dd>
<dt>Number</dt>
<dd><input type="number" name="number" value="0" /></dd>
<dt>Textarea</dt>
<dd><textarea name="textarea"></textarea></dd>
<dt>Radio</dt>
<dd>
<label for="radio1"><input type="radio" name="radio" id="radio1" value="radio1" /> radio1</label>
<label for="radio2"><input type="radio" name="radio" id="radio2" value="radio2" /> radio2</label>
<label for="radio3"><input type="radio" name="radio" id="radio3" value="radio3" /> radio3</label>
</dd>
<dt>Checkbox</dt>
<dd>
<label for="check1"><input type="checkbox" name="checkbox" id="check1" value="check1" /> check1</label>
</dd>
<dt>Checkbox (multiple)</dt>
<dd>
<label for="checkMulti1"><input type="checkbox" name="checkboxMulti" id="checkMulti1" value="checkMulti1" /> check1</label>
<label for="checkMulti2"><input type="checkbox" name="checkboxMulti" id="checkMulti2" value="checkMulti2" /> check2</label>
<label for="checkMulti3"><input type="checkbox" name="checkboxMulti" id="checkMulti3" value="checkMulti3" /> check3</label>
</dd>
<dt>Select</dt>
<dd>
<select name="select">
<option value="select1">select1</option>
<option value="select2">select2</option>
<option value="select3">select3</option>
<option value="select4">select4</option>
</select>
</dd>
<dt>Select (multiple)</dt>
<dd>
<select name="selectMulti" multiple="multiple">
<option value="selectMulti1">selectMulti1</option>
<option value="selectMulti2">selectMulti2</option>
<option value="selectMulti3">selectMulti3</option>
<option value="selectMulti4">selectMulti4</option>
</select>
</dd>
</dl>
<p>
<input type="submit" value="Get Value" />
</p>
</form>
</body>
</html>