Forum Replies Created

Viewing 1 replies (of 1 total)
  • This issue can be addressed either via JavaScript or PHP, depending on your preference and setup:

    • JavaScript: You can dynamically insert a <legend> element into each <fieldset> using a script after the DOM has loaded. This is useful when you don’t want to modify the form markup directly or need to support multiple forms.
    • PHP: Using the wpcf7_form_elements filter hook provided by Contact Form 7, you can modify the form’s HTML before it is rendered. This allows you to inject a <legend> server-side into any <fieldset> with a specific class (e.g., .hidden-fields-container), ensuring it’s part of the initial output.

    Both approaches are valid, but PHP is generally more robust for accessibility and SEO, while JavaScript offers flexibility if server-side changes aren’t practical.

Viewing 1 replies (of 1 total)