2013-02-06 107 views
0

嗯,我有這個表單標籤,完美的作品。rel屬性上<form>標籤

<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

你能告訴我們所有與你的facebox安裝相關的代碼嗎?你是否有所有相關的CSS和JS? –

+0

是的,我可以在整個我的頁面正確使用facebox ..等病把代碼放在文章中 –

+0

你是否收到JavaScript錯誤?如果是這樣,他們是什麼? –

回答

0

如果您正在使用jQuery您可以附加到窗體的方法提交給調用

jQuery.facebox({ ajax: 'searchresult.php' }); 

你會ofcourse必須通過以某些URL參數,它顯示的相關結果

東西像這樣會工作:

$('#search').submit(function() { 
     $.facebox({ ajax: 'searchresult.php?search=&search2=' }); 
     return false; 
}); 
+0

即時通訊使用這個jquery,生病嘗試添加。 jQuery(document).ready(function($){('a [rel * = facebox]')。facebox({0})圖片:'src/loading。 gif', closeImage:'src/closelabel.png' }) }) –

+0

您需要從輸入值創建變量以及不要忘記 – amof