0

我在我的网站上使用以下代码。您会注意到表单外有一个复选框(朝向底部)。我需要调用 send_mail.php 的复选框的值,而无需创建第二个表单,也无需将其放置在表单元素中。这甚至可以用 PHP 实现吗?`

                 <h2>Search for your dream home<br />
       and save now!</h2>
                <legend>Which Areas are you interested in?</legend>
                <div class="areas row-fluid" style="text-align:left !important;">                       
                    <div class='span5' style='margin-left:0px !important;'>
                        <label>
                            <input type="checkbox" name="arrayValue[]" id="area[0]" value="test" style='margin-top:-5px !important;'> test</label>
                    </div>          
                    </div>
                <input type="button" onclick="jQuery('#myModal').modal('show')" value="CONTINUE" />


        </div>
        </div>
    </div>

<!--banner area end-->
    <!--content area 1 start-->
    <div id="content1">
        <div class="content1_in"> <span> 
<h2 style="line-height:40px;font-size:40px;padding-bottom:10px">SOME CONTENT
</span>

            <div class="img">
               <img src="http://f14.co/realtor/assets/images/phone.png" alt="" />
            </div>
        </div>
    </div>
    <!--content area 1 end-->
    <!--content area 1 start-->
    <div id="content2">
        <div class="content2_in"> <span> SOME CONTENT
 </span>

            <div class="img">
                <img src="http://f14.co/realtor/assets/images/ipad-img.png" alt="" />
                <div class="key"></div>
            </div>
        </div> 
    </div>
    <!--content area 1 end-->
    <!--content area 3 start-->
    <div id="content3">
        <div class="content3_in"> <span> 
 SOME CONTENT 

</span>

            <div class="img">
                <img src="http://f14.co/realtor/assets/images/desktop-img.png" alt="" />
            </div>
            <div class="free"></div>
        </div>
    </div>
    <!--content area 3 end-->
    <div id="footer">
        <div class="footer_in">
            This Website Is Brought To You By: Test</div>
    </div>
    <!-- Modal -->
    <div id="myModal" class="modal hide fade modal-survey" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
             <h3 id="myModalLabel" class="survey_title">What type of home are you looking for?</h3>

        </div>
        <form method="post" class="form-horizontal" id="final_form" action="send_mail.php">
        <input type="hidden" name="template" id="template" value="Buyers" />
            <div class="modal-body" >
                <div id="lead_info_1">
                    <div class="input select">
                        <div class=""></div>...
4

1 回答 1

0

我会在您的表单中添加一个隐藏的输入。
然后,就在您的 之前post,将隐藏文本框的 赋值为复选框的值。
(使用 jQuery)

于 2013-08-07T16:58:23.510 回答