Implementing same Mailchimp Form in a page make it not valid

Hello everyone.
I want to validate my website but it’s not valid and the problem is I use the same Mailchimp Form in 2 different places in my template files. (in wide screens the main section form appears and in narrow screens the sidebar form appears) and as you know MC forms used ID. So validator give me Duplicate ID error.

Any idea on how to solve this ?

Thanks in advance.

It looks like you already know the problem and it sounds like you will need to change the ID and/or name value used on the second form. How can we help you do that?

You may need to provide us with a URL to your code page, or possibly post the full code in the form of a “working page” in your next post.

You can post the code by preceeding it with three backticks alone on one line, then pasting your code, then closing with three more backticks alone on one line. Like this:

```
your code here
```

1 Like

Thanks for your reply ronpat.
Yes, I need to change the ID attribute in one of the Mailchimp forms but I think it could make errors in processing the values posted to Mailchimp via the form. My assumption is true ?

Here’s link to desired webpage (Not in English)

What’s your suggestions to have both forms in one pages without giving Duplicate ID error in validator ?

Hi there okey,

i think that you can safely remove…

id="mc-embedded-subscribe-form"

…from the two forms.

There is no indication of it’s use in the CSS files.

Alternatively just give them each an unique “id”,
if you wish to apply additional styling.

coothead

1 Like

Thanks for your reply coothead.

Actually I don’t mind IDs for styling purpose, but aren’t those required for back end functionality. I mean, if I remove them anyone who add their email address in that input, will be added to my list in MC panel ?

I certainly would not have thought so. :mask:

But, not using or having any real knowledge of “MailChimp”,
I cannot say how mischievous it might be. :scream:

coothead

1 Like

Thanks coothead.

Any idea on this topic please ?

Yes, ids can be used by JavaScript, so messing with that might not be the best idea.

The obvious solution is to not have two of the forms in the same page.

That is, instead of having two forms and using media queries to show/hide them, have one form and use media queries to style it.

4 Likes

Thanks Mittineague.
It seems there’s no other way around so I should delete one of the forms. Unfortunately when coding the theme I didn’t thought about Duplicate IDs, validation etc. Now I’m going to delete sidebar form.

Thank you guys for your answers.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.