WordPress.org

Support

Support » Plugins and Hacks » Contact Form 7 » [Resolved] Adding an ID to the element markup

[Resolved] Adding an ID to the element markup

  • Chris

    @cferdinandi

    First off, thanks for building what is hands-down the best form plugin available for WordPress.

    Is there a way to add an ID to the <form> element in the markup? I don’t necessarily care if I can specificy it myself or if the ID used in the shortcode gets assigned, but it would be great to have <form id="1234" ...> in the markup.

    I’m working with a script that needs to target specific forms, and the lack of IDs is making things a tad more difficult.

    Thanks in advance!

    http://wordpress.org/plugins/contact-form-7/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Takayuki Miyoshi

    @takayukister

    <form> elements don’t have id attributes, but their parents <div> elements do. The plugin doesn’t have a feature to assign arbitrary id to <form> elem.

    Chris

    @cferdinandi

    @takayuki – Thanks for the quick response. Is there a reason why this decision was made? IDs are valid on the <form> element, and useful for scripting purposes.

    Chris

    @cferdinandi

    I ended up using node.parentNode.id to serve the same purpose. Thanks for the quick reply, and if at some point in the future you’d like to add a way to generate an ID on the form element itself, that would be awesome!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Adding an ID to the element markup’ is closed to new replies.
Skip to toolbar