0
我的困境:FORM要PHP重疊?
我在我的主頁上有一個搜索表單,我想提交給php搜索功能,然後將其結果發佈到疊加層而不離開主頁面。
這是我的表單代碼:
<form method="post" id="searchform" action="external-content.php" >
<div>
<input class="input-text" name="keyword" id="s" value="Enter your text here..." onFocus="if (this.value == 'Enter your text here...') {this.value = '';}" onBlur="if (this.value == '') {this.value = 'Enter your text here...';}" type="text" />
<input id="searchsubmit" value="Search" type="submit" />
</div>
</form>
這裏是我的代碼覆蓋:
<div class="apple_overlay" id="overlay">
<div class="contentWrap"></div>
</div>
<script src="js/overlay/jquery.tools.min.js"></script>
<script>
$(function() {
$("a[rel]").overlay({
mask: 'darkgrey',
effect: 'apple',
onBeforeLoad: function() {
var wrap = this.getOverlay().find(".contentWrap");
wrap.load(this.getTrigger().attr("href"));
}
});
});
</script>
疊加完美的作品時,我只是用一個簡單的按鈕來觸發覆蓋。表單調用PHP函數並顯示我想要顯示的數據,但它在不同的選項卡中打開數據。
我會編輯表單以使結果顯示在疊加層中(如果是這樣,怎麼樣?),還是腳本中有某些東西需要調整才能使這兩個元素一起工作?
colburton, 仍然打開PHP數據在新窗口中打開,而不是在它的數據覆蓋。 – user3230291
要打開一個新窗口,必須具有類似window.open或target =「_ new」或target =「_ blank」的內容。刪除 – colburton