<form method="POST" action="
<?php echo site_url
(array('A','update_info')) ?>">
<input type="hidden" id="old_values" name="old_values" />
<input type="hidden" id="new_values" name="new_values" />
someHTMLcode...
<script type="text/javascript" src="
<?php echo base_url
().'js/json2.js' ?>" ></script>
<script type="text/javascript">
<?php echo "var ov = (".$old_values.");\n"; ?>
//这里该怎么改?
//<input type="hidden" value="
<?php echo $old_values ?>" />
//可以吗?
document.getElementById("old_values").value = JSON.stringify(ov);
function _form_sumbit(_form) {
var arr = new Array();
for(var i = 0; i < _from.getElementsByTags("input").length; i++) {
//dosomething...
}
document.getElementById("new_values").value = JSON.stringify(arr);
_from.submit();
}
</script>
<input type="button" id="_submit" name="_submit" />
</form>