简体   繁体   English

停止打开新标签页

[英]Stop New Tab From Opening

I'm using mailchimp to create a signup sheet and every time the submit button is pressed, a new tab will open that confirms your subscription to the mailchimp email list. 我正在使用mailchimp创建一份注册表单,每按一次提交按钮,就会打开一个新标签,确认您对mailchimp电子邮件列表的订阅。 I want it to run as a sort of background process where no new tab is opened at all but the form is still submitted. 我希望它作为一种后台进程运行,在该进程中根本没有打开任何新选项卡,但仍提交了表单。 Here is the code I currently have with MailChimp: 这是我目前使用MailChimp的代码:

div id="mc_embed_signup">
<form action="//standrtech.us11.list-manage.com/subscribe/post?u=c330585c1144a0dd4bfd6d0df&amp;id=b7e663bdf4" method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate" target="_blank" novalidate>
    <div id="mc_embed_signup_scroll">
        <h2></h2>
    <div class="mc-field-group">
        <label for="mce-EMAIL">Email Address </label>
        <input type="email" value="" name="EMAIL" class="required email" id="mce-EMAIL" placeholder="Enter your email">
    </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 signup-->
        <div style="position: absolute; left: -5000px;"><input type="text" name="b_c330585c1144a0dd4bfd6d0df_b7e663bdf4" tabindex="-1" value=""></div>
            <div class="clear"><input type="submit" value="Get Early Access" name="subscribe" id="mc-embedded-subscribe" class="button" onclick="submission();"></div>
    </div>
</form>

I know I am a little too late for this, but I have found the solution for future references. 我知道我为时已晚,但是我找到了解决方案以供将来参考。

For 'classic' form only 仅适用于“经典”形式

Looks like the HTML code is not copied properly. 看起来HTML代码没有正确复制。 In the mailchimp embed form dashboard, look for the scripts after the outer div, the one containing the form, these scripts will validate your form. 在mailchimp嵌入表单仪表板中,在外部div之后查找脚本,该div包含表单,这些脚本将验证您的表单。 My embed form has two scripts after the outer div : 我的嵌入表单在外部div之后有两个脚本:

<script type='text/javascript' src='//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js'></script>

and

<script type='text/javascript'>(function($) {window.fnames = new Array(); window.ftypes = new Array();fnames[0]='EMAIL';ftypes[0]='email';fnames[1]='FNAME';ftypes[1]='text';fnames[2]='LNAME';ftypes[2]='text';}(jQuery));var $mcj = jQuery.noConflict(true);</script>

second script may vary depending upon your form fields, but I think you definitely need to add the mc-validate.js to resolve this issue. 第二个脚本可能会根据您的表单字段而有所不同,但是我认为您绝对需要添加mc-validate.js来解决此问题。

Hope this helps. 希望这可以帮助。

form标签中删除target="_blank"

in my case, it is because of the form validation script. 就我而言,这是因为表单验证脚本。 i removed the script and do a simple email input text validation on my own. 我删除了脚本,并自行进行了简单的电子邮件输入文本验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM