felixarntz / bootstrap-for-contact-form-7

This plugin modifies the output of the popular Contact Form 7 plugin to be styled in compliance with themes using the Bootstrap CSS framework.
https://wordpress.org/plugins/bootstrap-for-contact-form-7/
GNU General Public License v2.0
24 stars 18 forks source link

Required fields corrupting input groups #51

Closed ontiuk closed 6 years ago

ontiuk commented 6 years ago

The as a required field tag e.g text or email* is corrupting the display of input group {} shortcodes.

[text your-name]{input_before}@{/input_before}[/text] works ok. The html is injected ok <div class="input-group"><span class="input-group-addon">@</span><input class="wpcf7-form-control wpcf7-text form-control" name="your-name" type="text" value="" aria-invalid="false"></div>

[text* your-name]{input_before}@{/input_before}[/text] doesn't, {} shortcode isn't parsed and is echoed outside of the form-group tag.

Essentially no fields can be required when using input-groups. Tested with text, email, textarea.

Thanks

gidomanders commented 6 years ago

All shortcodes require the same closing tag, so you have to add the to the closing tag too, like [/text] or [/email*].

[text your-name]{input_before}@{/input_before}[/text]
[text* your-name]{input_before}@{/input_before}[/text*]