-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathtest.html
More file actions
32 lines (32 loc) · 986 Bytes
/
Copy pathtest.html
File metadata and controls
32 lines (32 loc) · 986 Bytes
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
<html>
<head>
<title>Test page for jquery.serialize.hash</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script src="jquery.serialize-hash.js"></script>
<script type="text/javascript">
$(document).ready(function() {
console.log($('#form').serializeHash());
/* Should log:
{
firstkey: 'val1',
email: 'me@example.com',
secondkey: {
0: 'val2',
1: 'val3',
key: 'val4'
}
}
*/
});
</script>
</head>
<body>
<form id="form">
<input type="text" name="firstkey" value="val1" />
<input type="email" name="email" value="me@example.com" />
<input type="hidden" name="secondkey[0]" value="val2" />
<input type="hidden" name="secondkey[1]" value="val3" />
<input type="hidden" name="secondkey[key]" value="val4" />
</form>
</body>
</html>