說我有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