好吧,我有这个表格标签可以很好地运作。
<form action="searchresult.php" method="post">
<?php
require('connect.inc');
$sql1="SELECT room_type,room_id FROM room";
$result1=mysql_query($sql1);
echo "<select name=roomtype value=''></option>";
while($nt=mysql_fetch_array($result1)){
echo "<option value=$nt[room_type]>$nt[room_type]</option>";
}
echo "</select>";
mysql_close();
?>
</td>
<td>
<input type='hidden' name='clientid' value="<?php echo $clientid; ?>">
<input type="text" class="w8em format-y-m-d highlight-days-67 range-low-today" name="chkin" id="sd" value="" maxlength="20" readonly />
</td>
<td>
<input type="text" class="w8em format-y-m-d highlight-days-67 range-low-today" name="chkout" id="ed" value="" maxlength="20" readonly />
</td>
</tr>
</table>
<input type='submit' name='submit' id="button1" value="Check Room Availabilty">
</form>
这将打开一个名为“searchresult.php”的新页面
但是,我需要知道的是,如何以弹出式样式显示此.php文件。
我目前正在使用facebox作为我的弹出窗口,我这样使用它:
<a rel="facebox" href="searchresult.php">Check Room Availability</a>
但是没有成功,输入没有传递到下一页,所以我得到错误。
我知道变量可以像这样传递一个标签
echo'<a rel="facebox" href=editroom.php?id=' . $row3["room_id"] . '>' . 'Edit' . '</a>';
但我现在的情况是,我需要输入传递。
我在每一页都声明了这些代码。
<link href="src/facebox.css" media="screen" rel="stylesheet" type="text/css" />
<script src="src/facebox.js" type="text/javascript"></script>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('a[rel*=facebox]').facebox({
loadingImage : 'src/loading.gif',
closeImage : 'src/closelabel.png'
})
})
感谢。
答案 0 :(得分:0)
如果您使用的是jQuery,则可以将方法附加到表单提交以调用
jQuery.facebox({ ajax: 'searchresult.php' });
您必须传递一些网址参数才能显示相关结果
这样的事情会起作用:
$('#search').submit(function() {
$.facebox({ ajax: 'searchresult.php?search=&search2=' });
return false;
});