说我有info.php
页面与用户信息(id,名称,年龄等)。
在此页面上,有一个'编辑'按钮,用户可以通过edit.php
上的表单来更改他们的信息。表单通过带有ID,名称,年龄等的$ _POST进行填充。
edit.php
有一个“更新”按钮,该按钮将更新后的数据发送回info.php
。这一切工作正常。
但是,当我尝试在jQuery Tools Overlay弹出窗口中加载edit.php
时,将出现edit.php
中的表单,但变量不会传递。相反,它们都显示为“未定义”。
我不确定在何处放置所需的href
元素,以便在覆盖图内传递我的变量到edit.php
。
任何想法?
<form action="edit.php" method="post">
<input type="hidden" name="edit" value="yes" />
<input type="hidden" name="id" value="<?php echo $row[1] ?>" />
<input type="hidden" name="name" value="<?php echo $row[2] ?>" />
<!-- this is the required href to trigger overlay -->
<a href="edit.php" rel="#overlay" style="text-decoration:none">
<input type="submit" value="Edit"/>
</a>
</form>
<div class="apple_overlay" id="overlay">
<!-- the external content is loaded inside this tag -->
<div class="contentWrap"></div>
</div>
<!-- make all links with the 'rel' attribute open overlays -->
<script>
$(function() {
// if the function argument is given to overlay,
// it is assumed to be the onBeforeLoad event listener
$("a[rel]").overlay({
mask: 'darkred',
effect: 'apple',
onBeforeLoad: function() {
// grab wrapper element inside content
var wrap = this.getOverlay().find(".contentWrap");
// load the page specified in the trigger
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
什么是jQuery Tools Overlay?你在谈论jQuery UI吗?这个源代码是edit.php还是? – macarthy 2011-02-08 03:33:02
哦,jQuery工具流水游戏... http://flowplayer.org/tools/index.html – macarthy 2011-02-08 03:41:41