2013-02-06 3 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> 

이 내가 알아야 할 것은 팝업 스타일이 .PHP 파일을 표시하는 방법이다 "searchresult.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 오류가 발생하고 있습니까? 그렇다면 무엇입니까? 이 jquery를 사용하여 –

답변

0

당신은

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

전화를 제출 양식하는 방법을 첨부 할 수 jQuery를 사용하는 경우 당신은 당연히이 관련 결과를

뭔가를 표시하기 위해 일부 URL 매개 변수를 전달해야 이렇게하면 작동합니다 :

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

메신저를 추가하십시오. jQuery (document) .ready (function ($) {$ ('a [rel * = facebox]') facebox ({ loadingImage : 'src/loading. gif ', closeImage :'src/closelabel.png ' } } –

+0

입력 값에서 변수를 만들어야합니다. 잊지 말아야합니다. – amof