{"id":4828773,"date":"2014-04-20T01:22:10","date_gmt":"2014-04-20T01:22:10","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/extra-field-appearing-submission-error-occuring\/"},"modified":"2016-08-21T19:31:49","modified_gmt":"2016-08-21T19:31:49","slug":"extra-field-appearing-submission-error-occuring","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/extra-field-appearing-submission-error-occuring\/","title":{"rendered":"Extra Field Appearing &amp; Submission Error Occuring"},"content":{"rendered":"<p>I have another question.  <\/p>\n<p>I have done all of the instructions using your videos and I have inserted the following code from MailChimp<\/p>\n<pre><code>&lt;!-- Begin MailChimp Signup Form --&gt;\n&lt;link href=&quot;\/\/cdn-images.mailchimp.com\/embedcode\/classic-081711.css&quot; rel=&quot;stylesheet&quot; type=&quot;text\/css&quot;&gt;\n&lt;style type=&quot;text\/css&quot;&gt;\n\t#mc_embed_signup{background:#fff; clear:left; font:14px Helvetica,Arial,sans-serif; }\n\t\/* Add your own MailChimp form style overrides in your site stylesheet or in this style block.\n\t   We recommend moving this block and the preceding CSS link to the HEAD of your HTML file. *\/\n&lt;\/style&gt;\n&lt;div id=&quot;mc_embed_signup&quot;&gt;\n&lt;form action=&quot;http:\/\/14erskiers.us8.list-manage.com\/subscribe\/post?u=9f4d6dca6d23c9d2aa1169dae&amp;id=12cf932ca1&quot; method=&quot;post&quot; id=&quot;mc-embedded-subscribe-form&quot; name=&quot;mc-embedded-subscribe-form&quot; class=&quot;validate&quot; target=&quot;_blank&quot; novalidate&gt;\n\t&lt;h2&gt;Subscribe to our mailing list&lt;\/h2&gt;\n&lt;div class=&quot;indicates-required&quot;&gt;&lt;span class=&quot;asterisk&quot;&gt;*&lt;\/span&gt; indicates required&lt;\/div&gt;\n&lt;div class=&quot;mc-field-group&quot;&gt;\n\t&lt;label for=&quot;mce-EMAIL&quot;&gt;Email Address  &lt;span class=&quot;asterisk&quot;&gt;*&lt;\/span&gt;\n&lt;\/label&gt;\n\t&lt;input type=&quot;email&quot; value=&quot;&quot; name=&quot;EMAIL&quot; class=&quot;required email&quot; id=&quot;mce-EMAIL&quot;&gt;\n&lt;\/div&gt;\n\t&lt;div id=&quot;mce-responses&quot; class=&quot;clear&quot;&gt;\n\t\t&lt;div class=&quot;response&quot; id=&quot;mce-error-response&quot; style=&quot;display:none&quot;&gt;&lt;\/div&gt;\n\t\t&lt;div class=&quot;response&quot; id=&quot;mce-success-response&quot; style=&quot;display:none&quot;&gt;&lt;\/div&gt;\n\t&lt;\/div&gt;    &lt;!-- real people should not fill this in and expect good things - do not remove this or risk form bot signups--&gt;\n    &lt;div style=&quot;position: absolute; left: -5000px;&quot;&gt;&lt;input type=&quot;text&quot; name=&quot;b_9f4d6dca6d23c9d2aa1169dae_12cf932ca1&quot; value=&quot;&quot;&gt;&lt;\/div&gt;\n\t&lt;div class=&quot;clear&quot;&gt;&lt;input type=&quot;submit&quot; value=&quot;Subscribe&quot; name=&quot;subscribe&quot; id=&quot;mc-embedded-subscribe&quot; class=&quot;button&quot;&gt;&lt;\/div&gt;\n&lt;\/form&gt;\n&lt;\/div&gt;\n&lt;script type=&quot;text\/javascript&quot;&gt;\nvar fnames = new Array();var ftypes = new Array();fnames[0]=&#039;EMAIL&#039;;ftypes[0]=&#039;email&#039;;\ntry {\n    var jqueryLoaded=jQuery;\n    jqueryLoaded=true;\n} catch(err) {\n    var jqueryLoaded=false;\n}\nvar head= document.getElementsByTagName(&#039;head&#039;)[0];\nif (!jqueryLoaded) {\n    var script = document.createElement(&#039;script&#039;);\n    script.type = &#039;text\/javascript&#039;;\n    script.src = &#039;\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.4.4\/jquery.min.js&#039;;\n    head.appendChild(script);\n    if (script.readyState &amp;&amp; script.onload!==null){\n        script.onreadystatechange= function () {\n              if (this.readyState == &#039;complete&#039;) mce_preload_check();\n        }\n    }\n}\n\nvar err_style = &#039;&#039;;\ntry{\n    err_style = mc_custom_error_style;\n} catch(e){\n    err_style = &#039;#mc_embed_signup input.mce_inline_error{border-color:#6B0505;} #mc_embed_signup div.mce_inline_error{margin: 0 0 1em 0; padding: 5px 10px; background-color:#6B0505; font-weight: bold; z-index: 1; color:#fff;}&#039;;\n}\nvar head= document.getElementsByTagName(&#039;head&#039;)[0];\nvar style= document.createElement(&#039;style&#039;);\nstyle.type= &#039;text\/css&#039;;\nif (style.styleSheet) {\n  style.styleSheet.cssText = err_style;\n} else {\n  style.appendChild(document.createTextNode(err_style));\n}\nhead.appendChild(style);\nsetTimeout(&#039;mce_preload_check();&#039;, 250);\n\nvar mce_preload_checks = 0;\nfunction mce_preload_check(){\n    if (mce_preload_checks&gt;40) return;\n    mce_preload_checks++;\n    try {\n        var jqueryLoaded=jQuery;\n    } catch(err) {\n        setTimeout(&#039;mce_preload_check();&#039;, 250);\n        return;\n    }\n    var script = document.createElement(&#039;script&#039;);\n    script.type = &#039;text\/javascript&#039;;\n    script.src = &#039;http:\/\/downloads.mailchimp.com\/js\/jquery.form-n-validate.js&#039;;\n    head.appendChild(script);\n    try {\n        var validatorLoaded=jQuery(&quot;#fake-form&quot;).validate({});\n    } catch(err) {\n        setTimeout(&#039;mce_preload_check();&#039;, 250);\n        return;\n    }\n    mce_init_form();\n}\nfunction mce_init_form(){\n    jQuery(document).ready( function($) {\n      var options = { errorClass: &#039;mce_inline_error&#039;, errorElement: &#039;div&#039;, onkeyup: function(){}, onfocusout:function(){}, onblur:function(){}  };\n      var mce_validator = $(&quot;#mc-embedded-subscribe-form&quot;).validate(options);\n      $(&quot;#mc-embedded-subscribe-form&quot;).unbind(&#039;submit&#039;);\/\/remove the validator so we can get into beforeSubmit on the ajaxform, which then calls the validator\n      options = { url: &#039;http:\/\/14erskiers.us8.list-manage.com\/subscribe\/post-json?u=9f4d6dca6d23c9d2aa1169dae&amp;id=12cf932ca1&amp;c=?&#039;, type: &#039;GET&#039;, dataType: &#039;json&#039;, contentType: &quot;application\/json; charset=utf-8&quot;,\n                    beforeSubmit: function(){\n                        $(&#039;#mce_tmp_error_msg&#039;).remove();\n                        $(&#039;.datefield&#039;,&#039;#mc_embed_signup&#039;).each(\n                            function(){\n                                var txt = &#039;filled&#039;;\n                                var fields = new Array();\n                                var i = 0;\n                                $(&#039;:text&#039;, this).each(\n                                    function(){\n                                        fields[i] = this;\n                                        i++;\n                                    });\n                                $(&#039;:hidden&#039;, this).each(\n                                    function(){\n                                        var bday = false;\n                                        if (fields.length == 2){\n                                            bday = true;\n                                            fields[2] = {&#039;value&#039;:1970};\/\/trick birthdays into having years\n                                        }\n                                    \tif ( fields[0].value==&#039;MM&#039; &amp;&amp; fields[1].value==&#039;DD&#039; &amp;&amp; (fields[2].value==&#039;YYYY&#039; || (bday &amp;&amp; fields[2].value==1970) ) ){\n                                    \t\tthis.value = &#039;&#039;;\n\t\t\t\t\t\t\t\t\t    } else if ( fields[0].value==&#039;&#039; &amp;&amp; fields[1].value==&#039;&#039; &amp;&amp; (fields[2].value==&#039;&#039; || (bday &amp;&amp; fields[2].value==1970) ) ){\n                                    \t\tthis.value = &#039;&#039;;\n\t\t\t\t\t\t\t\t\t    } else {\n\t\t\t\t\t\t\t\t\t        if (\/\\[day\\]\/.test(fields[0].name)){\n    \t                                        this.value = fields[1].value+&#039;\/&#039;+fields[0].value+&#039;\/&#039;+fields[2].value;\n\t\t\t\t\t\t\t\t\t        } else {\n    \t                                        this.value = fields[0].value+&#039;\/&#039;+fields[1].value+&#039;\/&#039;+fields[2].value;\n\t                                        }\n\t                                    }\n                                    });\n                            });\n                        $(&#039;.phonefield-us&#039;,&#039;#mc_embed_signup&#039;).each(\n                            function(){\n                                var fields = new Array();\n                                var i = 0;\n                                $(&#039;:text&#039;, this).each(\n                                    function(){\n                                        fields[i] = this;\n                                        i++;\n                                    });\n                                $(&#039;:hidden&#039;, this).each(\n                                    function(){\n                                        if ( fields[0].value.length != 3 || fields[1].value.length!=3 || fields[2].value.length!=4 ){\n                                    \t\tthis.value = &#039;&#039;;\n\t\t\t\t\t\t\t\t\t    } else {\n\t\t\t\t\t\t\t\t\t        this.value = &#039;filled&#039;;\n\t                                    }\n                                    });\n                            });\n                        return mce_validator.form();\n                    },\n                    success: mce_success_cb\n                };\n      $(&#039;#mc-embedded-subscribe-form&#039;).ajaxForm(options);\n\n    });\n}\nfunction mce_success_cb(resp){\n    $(&#039;#mce-success-response&#039;).hide();\n    $(&#039;#mce-error-response&#039;).hide();\n    if (resp.result==&quot;success&quot;){\n        $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).show();\n        $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).html(resp.msg);\n        $(&#039;#mc-embedded-subscribe-form&#039;).each(function(){\n            this.reset();\n    \t});\n    } else {\n        var index = -1;\n        var msg;\n        try {\n            var parts = resp.msg.split(&#039; - &#039;,2);\n            if (parts[1]==undefined){\n                msg = resp.msg;\n            } else {\n                i = parseInt(parts[0]);\n                if (i.toString() == parts[0]){\n                    index = parts[0];\n                    msg = parts[1];\n                } else {\n                    index = -1;\n                    msg = resp.msg;\n                }\n            }\n        } catch(e){\n            index = -1;\n            msg = resp.msg;\n        }\n        try{\n            if (index== -1){\n                $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).show();\n                $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).html(msg);\n            } else {\n                err_id = &#039;mce_tmp_error_msg&#039;;\n                html = &#039;&lt;div id=&quot;&#039;+err_id+&#039;&quot; style=&quot;&#039;+err_style+&#039;&quot;&gt; &#039;+msg+&#039;&lt;\/div&gt;&#039;;\n\n                var input_id = &#039;#mc_embed_signup&#039;;\n                var f = $(input_id);\n                if (ftypes[index]==&#039;address&#039;){\n                    input_id = &#039;#mce-&#039;+fnames[index]+&#039;-addr1&#039;;\n                    f = $(input_id).parent().parent().get(0);\n                } else if (ftypes[index]==&#039;date&#039;){\n                    input_id = &#039;#mce-&#039;+fnames[index]+&#039;-month&#039;;\n                    f = $(input_id).parent().parent().get(0);\n                } else {\n                    input_id = &#039;#mce-&#039;+fnames[index];\n                    f = $().parent(input_id).get(0);\n                }\n                if (f){\n                    $(f).append(html);\n                    $(input_id).focus();\n                } else {\n                    $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).show();\n                    $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).html(msg);\n                }\n            }\n        } catch(e){\n            $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).show();\n            $(&#039;#mce-&#039;+resp.result+&#039;-response&#039;).html(msg);\n        }\n    }\n}\n\n&lt;\/script&gt;\n&lt;!--End mc_embed_signup--&gt;<\/code><\/pre>\n<p>However, when inserted, the form has an extra field.  I deleted all fields except for the email address.  When I look at the form directly through MailChimp, it does not have the extra field as shown in the screen shot:<br \/>\n<a href=\"http:\/\/14erskiers.com\/blog\/?attachment_id=7205\">http:\/\/14erskiers.com\/blog\/?attachment_id=7205<\/a><\/p>\n<p>How can I eliminate this extra field?<\/p>\n<p>In addition, I think that this is interfering with the submission of the form.  When I do a test submission, this error occurs (and the email address is NOT in my actual MailChimp account):<br \/>\n<a href=\"http:\/\/14erskiers.com\/blog\/?attachment_id=7205\">http:\/\/14erskiers.com\/blog\/?attachment_id=7206<\/a><\/p>\n<p>https:\/\/wordpress.org\/plugins\/wp-lead-plus-free-squeeze-pages-creator\/<\/p>\n","protected":false},"template":"","class_list":["post-4828773","topic","type-topic","status-closed","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4828773","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/4828773\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=4828773"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}