info.php
ユーザー情報(ID、名前、年齢など)を含むページがあるとします。
このページには、ユーザーがedit.php
情報を変更できるフォームに移動する「編集」ボタンがあります。フォームには、ID、名前、年齢などの $_POST を介して入力されます。
edit.php
更新されたデータでポストバックする「更新」ボタンがinfo.php
あります。これはすべてうまくいきます。
しかしedit.php
、jQuery Tools Overlay ポップアップ内でロードしようとすると、フォームは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>