如何通过在模态窗口中传递id值来在模态窗口中显示特定项目的文本?

时间:2016-11-10 10:16:53

标签: php

我有一个不同数量的包的html代码,如下所示:

 <article class="col-lg-4 col-md-4 col-sm-6 col-xs-12 baner-box">
                    <div class="thumb-pad1">
                                              <div class="thumbnail">
                                                  <figure>
                                                        <img src="images/packages/<?php echo $arr["package_image"]; ?>" alt="">
                                                        <h3>Hi</h3>
                                                        <h4>Welcome</h4>
                                                        <p>fggf</p>
                                                        <div class="package-btn">
                                                                <a data-toggle="modal" href="#myModal" class="btn btn-submit" >Book / Enquiry / Pay</a>

                                                        </div>
                                                  </figure>
                                              </div>
                    </div>
                </article>

当我点击上面代码中的Book / Inquiry / Pay按钮时,会打开一个模态窗口。模态代码如下所示:

<div class="modal fade" id="myModal">
<div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Enquiry / Booking / Payment</h4>

        </div>

     <div id="contact_form_bg">
     <div class="form_header">


      </div>
     <div class="contact_form body">
     <form action="#contactForm" id="contactForm" method="post" enctype="multipart/form-data">
    <ul>

      <li>
      <p class="left">

        <input type="date" name="date" placeholder="Date" required>
      </p>
      <p class="left">

        <input type="time" name="time" placeholder="Time" required>      
      </p>
      <p class="left">

        <input type="text" name="name" placeholder="Full Name" required>      
      </p>
      <p class="left">

       <input type="text" name="name" placeholder="Contact Number" required>  
      </p>
    </li>

    <li>
      <p class="left">
       <input type="email" name="mail" placeholder="Your Email" required>  

      </p>
       <p class="left">

        <input type="text" name="no-of-people" placeholder="Selected Package">        
      </p>
      <p class="left">


  <select>
   <option value="" disabled="disabled" selected="selected">Select Your Package Type</option>
   <option value="1"> 14 Days - Rs.20000 </option>
   <option value="2">21 Days - Rs.25000</option>
    </select>            
      </p>
       <p class="left">


  <select>
     <option value="" disabled="disabled" selected="selected">Gender</option>
    <option value="1">Female</option>
    <option value="2">Male</option>
 </select>           
      </p>


    </li>        

    <li>
     <p class="txtarea-style">
      <textarea cols="46" rows="3" name="comments" placeholder="Message With Us ...."></textarea>
      </p>
      <p>
      <input class="btn btn-submit" type="submit" value="Enquiry">
      </p>
      <p>
      <input class="btn btn-submit" type="submit" value="Booking">
      </p>
     <!-- <p>
       <a data-toggle="modal" href="#myModal2" class="btn btn-submit" >Booking with Payment </a>
      </p>-->

    </li>


     </ul>
   </form>  
 </div>
 </div>
    </div>
   </div>
</div>

我希望通过传递数据库中特定包的id值来显示模态窗口中所选包字段中标记中相应包的值,并显示所有值,并且

标签。对于每个包,都会有这篇文章代码,我希望通过在数据库中传递特定包的id值,在所选包输入字段的相应模式窗口中显示每个包中的所有值。

0 个答案:

没有答案