Bug Tracker

Ticket #3588: test.html

File test.html, 1.4 KB (added by pbowyer, 11 years ago)

Demonstration file, showing how serialization doesn't work

Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html>
3<head>
4        <title>Foo</title>
5</head>
6
7<body>
8
9<form method="post" action="">
10
11
12<!-- hundreds of lines of stuff -->
13
14<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
15<script type="text/javascript">
16function updateGallery()
17{
18  // var str = $("form").serializeArray(); // This works
19  var str = $("form #galleryUpdate").serializeArray(); // This doesn't
20  console.log(str);
21  //$.post("/assets/plugins/gallery/update.php", str, function(data){ console.log(data); });
22
23}
24</script>
25
26<div id="galleryUpdate">
27<table>
28<tr>
29  <td>1.jpg</td><td><input type="text" name="caption[1]"></td><td><a href="#" onclick="deleteGalleryFile(this, '1', 13); return false" class="deleteFile" title="Delete file"></a></td>
30</tr>
31<tr>
32  <td>2.jpg</td><td><input type="text" name="caption[2]"></td><td><a href="#" onclick="deleteGalleryFile(this, '2', 13); return false" class="deleteFile" title="Delete file"></a></td>
33
34</tr>
35<tr>
36  <td>3.png</td><td><input type="text" name="caption[3]"></td><td><a href="#" onclick="deleteGalleryFile(this, '3', 13); return false" class="deleteFile" title="Delete file"></a></td>
37</tr>
38</table>
39
40<input type="button" name="submit" value="Save" onclick="updateGallery()">
41</div>
42
43<!-- Rest of document -->
44
45</form>
46
47</body>
48</html>
49<!-- end footer -->
50