简体   繁体   English

的rel属性 <form> 标签

[英]rel attribute on <form> tag

Well, I have this form tag which works perfectly. 好吧,我有这个完美的表单标签。

<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>

This opens up to a new page named "searchresult.php" 这将打开一个名为“ searchresult.php”的新页面。

But,what I need to know is, how to display this .php file in a pop up style. 但是,我需要知道的是如何以弹出样式显示此.php文件。

I am currently using facebox as my pop up,and I use it like this: 我目前正在使用facebox作为弹出窗口,并且使用它的方式如下:

<a rel="facebox" href="searchresult.php">Check Room Availability</a>

But to no success, the inputs are not passing to the next page,so I get errors. 但是没有成功,输入没有传递到下一页,因此出现错误。

I know variables can be pass through the a tag like this 我知道变量可以通过这样的标签传递

echo'<a rel="facebox" href=editroom.php?id=' . $row3["room_id"] . '>' . 'Edit' . '</a>';

But my case now is , I need the inputs to be pass. 但是我现在的情况是,我需要传递输入。

I declare this codes in every page. 我在每一页中声明此代码。

<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'
  })
})

Thanks. 谢谢。

If you are using jQuery you could attach a method to the form submit to call 如果您使用的是jQuery,则可以将方法附加到表单提交以调用

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

You will ofcourse have to pass some URL parameters in order for it to display the relevant results 当然,您将必须传递一些URL参数才能显示相关结果。

Something like this will work: 这样的事情会起作用:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM