Support » Plugin: Material Design for Contact Form 7 » Duplicate ID cf7md-form

  • Resolved Max Zhupikov

    (@maxzhupikov)


    Good day!
    When I put two or more forms with MD grid on the same page, I get the Duplicate ID error. Really, each form wrapper has the same ID “cf7md-form” (Plugin ver. 2.6.2, file cf7-material-design-public.php, line 122)
    Maybe it should better be class, not id? Or have auto-generated “tail”, e.g. “cf7md-form-xx”?
    Thanks!

    • This topic was modified 1 year, 4 months ago by Max Zhupikov.
Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Contributor Addons for Contact Form 7

    (@contactform7addons)

    Hi @maxzhupikov

    Thanks for using the plugin!

    This was a conscious design decision and it is done so that the CSS can be more specific and therefore override theme CSS – all the CSS selectors for the plugin’s components are nested under #cf7md-form, which makes the rules more specific than if we were to use a class or just omit the parent entirely. By doing this we ensure the plugin works with a wider range of themes.

    While it is technically invalid HTML to have identical IDs on a page, it should not ever cause you any issues. It would only cause issues if you tried to target that ID with JavaScript or a for attribute, aria attribute, etc (which you should never need to do).

    Thanks,
    Angus

    Thread Starter Max Zhupikov

    (@maxzhupikov)

    Thanks you for the answer! In fact, this is not so important to myself, but the SEO-specialist whines that the validation does not pass and that site loses its positions :)))

    Plugin Contributor Addons for Contact Form 7

    (@contactform7addons)

    Ah I see. According to Google, valid HTML does not play a role in the ranking algorithm – https://www.searchenginejournal.com/google-valid-html/258881/#close

    Thread Starter Max Zhupikov

    (@maxzhupikov)

    Thank you!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Duplicate ID cf7md-form’ is closed to new replies.