Skip to main content

Bug Tracker

Side navigation

Ticket #3588: test.html


File test.html, 1.4 KB (added by pbowyer, November 10, 2008 11:59AM UTC)

Demonstration file, showing how serialization doesn't work

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>Foo</title>
</head>

<body>

<form method="post" action="">


<!-- hundreds of lines of stuff -->

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"></script>
<script type="text/javascript">
function updateGallery()
{
  // var str = $("form").serializeArray(); // This works
  var str = $("form #galleryUpdate").serializeArray(); // This doesn't
  console.log(str);
  //$.post("/assets/plugins/gallery/update.php", str, function(data){ console.log(data); });

}
</script>

<div id="galleryUpdate">
<table>
<tr>
  <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>
</tr>
<tr>
  <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>

</tr>
<tr>
  <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>
</tr>
</table>

<input type="button" name="submit" value="Save" onclick="updateGallery()">
</div>

<!-- Rest of document -->

</form>

</body>
</html>
<!-- end footer -->

Download in other formats:

Original Format