我的表格不会提交?

时间:2014-04-09 20:27:13

标签: jquery html forms email

我100%肯定这是一个愚蠢的问题,但是请帮助!我想要的只是一个将结果发送到电子邮件地址的表单。我设置了表单(使用jquery根据需要隐藏/显示字段并向某些字段提供工具包信息)并且一切都很好,除非你点击“提交”.....没有任何反应!我把页面放到了http://validator.w3.org/,它告诉我我的开始表单标签没有关闭,我的结束表单标签已被检测到,但是没有开始表单标签,所以我想由于某种原因他们不是'连接?我做错了什么可怕的蠢事?

这是我的html:

<form method="post" action="MAILTO:lawrk385@newschool.edu" enctype="text/plain">
<div class="column2">
    <ul>
        <li>
            <p>Name:
                <input type="text" required size="30" maxlength="60" name="name">
                <p>Email:
                    <input type="text" required size="30" maxlength="60" name="name">
                    <p>Phone Number:
                        <input type="text" required size="30" maxlength="60" name="name">
                        <p>Gender:
                            <input type="radio" required name="gender" value="Female">Female
                            <input type="radio" name="gender" value="Male">Male</li>
        <li>
            <p>Street Address:
                <input type="text" required size="30" maxlength="60" name="name">
                <p>City:
                    <input type="text" required size="30" maxlength="60" name="name">
                    <p>State:
                        <input type="text" required size="2" maxlength="2" name="state">
                        <p>Zip Code:
                            <input type="text" required size="6" maxlength="6" name="name">
        </li>
    </ul>
</div>
<div class="line"></div>
    <h4>Order Information</h4>

<div class="line"></div>
<div class="column2">
    <ul>
        <li>
            <p>Product:
                <select id="product" name="product">
                    <option value="0"></option>
                    <option value="1">Samue</option>
                    <option value="2">Robe</option>
                    <option value="3">Jubon</option>
                    <option value="4">Rakusu</option>
                    <option value="5">Support Cushion</option>
                    <option value="6">Zafu</option>
                    <option value="7">Zabuton</option>
                </select>
                <p>Amount:
                    <select name="Amount" required>
                        <option></option>
                        <option>1</option>
                        <option>2</option>
                        <option>3</option>
                        <option>4</option>
                        <option>5</option>
                    </select>
        </li>
        <li>
            <div id="samue_measurements">
                <p>Size:
                    <select name="size">
                        <option>XS</option>
                        <option>S</option>
                        <option>M</option>
                        <option>L</option>
                        <option>XL</option>
                    </select>
                    <p>Color:
                        <select name="color">
                            <option>Denim Sky</option>
                            <option>Artichoke Hemp</option>
                            <option>Leaf Hemp</option>
                            <option>Navy Hemp</option>
                            <option>Sand Hemp</option>
                            <option>Smoke Hemp</option>
                            <option>Bark Twill</option>
                            <option>Navy Twill</option>
                            <option>Olive Twill</option>
                            <option>Stone Twill</option>
                            <option>Wine Twill</option>
                        </select>
            </div>
            <div id="robe_measurements">
                <p>Chest:
                    <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/chest.jpg"><br />Measure chest at widest point.</span></a>

                    <p>Waist:
                        <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/waist.jpg"><br />Measure waist at narrowest point.</span></a>

                        <p>Hip:
                            <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/hip.jpg"><br />Measure hip at widest point.</span></a>

                            <p>Center Front:
                                <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/centerfront.jpg"><br />Measure neck to waist.</span></a>

                                <p>Waist to Floor:
                                    <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/waisttofloor.jpg"><br />Measure from waist to floor.</span></a>

                                    <p>Arm Length:
                                        <input type="text" required size="10" maxlength="15" name="name"> <a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/armlength.jpg"><br />Place arm on hip. Measure outside of arm from neck to wrist.</span></a>

                                        <p>Color:
                                            <select name="color">
                                                <option>Navy Hemp</option>
                                                <option>Sand Hemp</option>
                                                <option>Smoke Hemp</option>
                                                <option>Bark Twill</option>
                                                <option>Navy Twill</option>
                                                <option>Stone Twill</option>
                                            </select>
            </div>
            <div id="rakusu_measurements">
                <p>Strap Length:
                    <input type="text" required size="10" maxlength="15" name="name"><a class="thumbnail" href="#thumb"><sup>?</sup><span><img width="200px" height="auto" src="img/straplength.jpg"><br />Measure around neck to where top of rakusu front should land.</span></a>

                    <p>Material:
                        <select name="material">
                            <option>Linen</option>
                            <option>Cotton</option>
                        </select>
                        <p>Ring:
                            <select name="material">
                                <option>None</option>
                                <option>Birch</option>
                                <option>Maple</option>
                            </select>
            </div>
            <div id="jubon_measurements">
                <p>Size:
                    <select name="size">
                        <option>XS</option>
                        <option>S</option>
                        <option>M</option>
                        <option>L</option>
                        <option>XL</option>
                    </select>
                    <p>Body Material:
                        <select name="material">
                            <option>Organic Fleece</option>
                            <option>Organic Thermal</option>
                            <option>Cotton</option>
                            <option>Fleece</option>
                            <option>Thermal</option>
                        </select>
                        <p>Collar Material:
                            <select name="material">
                                <option>Twill</option>
                                <option>Silk</option>
                            </select>
            </div>
</div>
</li>
</ul>
</div>
<div class="line"></div>
    <h4>Additional Comments</h4>

<div class="line"></div>
<div style="text-align:center; padding:2em;">
    <textarea rows="4" cols="50"></textarea>
</div>
<div style="text-align:center;padding:2em;">
    <input type="submit" value="Submit">
    <input type="reset" value="Reset">
</div>

我把所有东西放在jsfiddle上,由于某些原因我的切换不起作用,虽然它在网站上运行良好。这是:http://jsfiddle.net/HMfWc/(更新更准确的代码)

1 个答案:

答案 0 :(得分:3)

mailto: form actions don't work。您需要将action设置为HTTP(或HTTPS)URL并使用服务器端程序(可以通过电子邮件将数据发送给您)以您选择的语言(或通过第三方)。

您还需要删除enctype="text/plain",因为此编码不能可靠地进行机器解析,并且表单处理程序库通常不会识别它。