"必需"属性在 MailChimp 注册表单上不起作用



我正在用Mailchimp创建一个非常基本的注册表单,并将其嵌入到我的网站中。

我已经在表单中包含了required属性。当提交时,将出现一个弹出窗口";请填写此字段";。不幸的是,这不起作用。

<div id="mc_embed_signup">
<form action=""
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank"
novalidate>
<div id="mc_embed_signup_scroll">
<div class="mc-field-group">
<label class="required" for="mce-EMAIL">Email Address</span>
</label>
<input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" required />
</div>
<div id="mce-responses" class="clear">
<div class="response" id="mce-error-response" style="display:none"></div>
<div class="response" id="mce-success-response" style="display:none"></div>
</div>
<!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups-->
<div style="position: absolute; left: -5000px;" aria-hidden="true"><input type="text"
name="b_2e4b9b144fbbafc48f6f8a2a5_800e0efef3" tabindex="-1" value=""></div>
<div class="clear"><input type="submit" value="Subscribe" name="subscribe" id="mc-embedded-subscribe"
class="button"></div>
</div>
</form>
</div>

然而,像这样简单的东西确实有效:

<code class="hljs xml"><form>
<input type="email" required /> <br />
<input type="submit" value="Submit Now!">
</form></code>

novalidate表单属性指定提交时不应验证表单。现在已将其删除。

相关内容

  • 没有找到相关文章

最新更新