发送电子邮件选择复选框html

时间:2018-11-04 22:32:27

标签: php html

我试图让我的科学家选择他们希望通过电子邮件获得的服务。我收到了电子邮件,但服务为空,我的PHP文件错误。预先谢谢你

<h3>Tell us your inquiries</h3>

<hr>
<form id="contact-form" action="mailto:info@dosaladesign.com" method="post" onsubmit="return checkform(this);">
<div class="form-group">
<label for="firstname">First Name <span class="form-required" title="This field is required.">*</span></label>
<input type="text" name="firstname" class="form-control half" id="firstname" required>
                                            </div>
                                            <div class="form-group">
                                                <label for="lastname">Last Name <span class="form-required" title="This field is required.">*</span></label>
                                                <input type="text" name="lastname" class="form-control half" id="lastname" required>
                                            </div>
                                            <div class="form-group">
                                                <label for="email">E-mail <span class="form-required" title="This field is required.">*</span></label>
                                                <input type="email" name="email" class="form-control half" id="email" required>
                                            </div>
                                            <div class="form-group">
                                                <label for="subject">Zip Code <span class="form-required" title="This field is required.">*</span></label>
                                                <input type="text" name="zipcode" class="form-control half" id="zipcode" required>
                                            </div>
                                            <div class="form-group" >
                                                <label for="email">Select Services</label>
                                            <div class="row1">
                                                    <div class="col1"><input id="chk1" type="checkbox"><label>As-Built</label></div>
                                                <div class="col1"><input id="chk2" type="checkbox" onclick="myFunction('New Construction Design','chk2')"/><label>New Construction Design</label></div>
                                                <div class="col1"><input id="chk3" type="checkbox" onclick="myFunction('Residential Remodels','chk3')"/><label>Residential Remodels</label></div>
                                                <div class="col1"><input id="chk4" type="checkbox" onclick="myFunction('Residential Additions','chk4')"/><label>Residential Additions</label></div>
                                                <div class="col1"><input id="chk5" type="checkbox" onclick="myFunction('3D Modeling and Renderings','chk5')"/><label>3D Modeling and Renderings</label></div>
                                                <div class="col1"><input id="chk6" type="checkbox" onclick="myFunction('Interior Design','chk6')"/><label>Interior Design</label></div>
                                                <div class="col1"><input id="chk7" type="checkbox" onclick="myFunction('Space Planning and Furniture Layouts','chk7')"/><label>Space Planning and Furniture Layouts</label></div>
                                                <div class="col1"><input id="chk8" type="checkbox" onclick="myFunction('Custom Furniture Design','chk8')"/><label>Custom Furniture Design</label></div>
                                                <div class="col1"><input id="chk9" type="checkbox" onclick="myFunction('Landscape Design','chk9')"/><label>Landscape Design</label></div>

                                            </div>
                                            </div>
                                                                                <div class="form-group">
                                                <label for="message">Message <span class="form-required" title="This field is required.">*</span></label>
                                                <textarea  name="message" class="form-control" rows="4" id="message" required></textarea>

1 个答案:

答案 0 :(得分:-1)

确保您的输入元素包含名称属性和值。根据规范:如果未指定名称,或者名称为空,则输入的值不会与表单一起提交。

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#name