• Resolved jbx

    (@jbx)


    For some stupid reason, <p> tags are being inserted around my Submit element where I didn’t tell it to. I also explicitly used the <input> tag rather the [submit] tag to avoid this thing (and also that rotating gif that there doesn’t seem any way of removing otherwise).

    This is my code put in the Contact Form:

    <p><label for="name">Name & Surname</label>?[text* name id:name]</p>
    <p><label for="email">E-mail?Address</label>?[email* email id:email]</p>
    <p><label for="number">Contact Number</label>?[tel number id:number]</p>
    <p><label for="subject">Subject</label>?[text* subject id:subject]</p>
    <p><label for="message">Message</label><br/>[textarea* message 42x9 id:message]</p>
    
    <input type="submit" id="send" name="send" value="SEND" />

    When I do view source however I get this:

    <form action="/contact-us/#wpcf7-f50-p15-o1" method="post" class="wpcf7-form" novalidate="novalidate">
    <div style="display: none;">
    <input type="hidden" name="_wpcf7" value="50" />
    <input type="hidden" name="_wpcf7_version" value="3.8.1" />
    <input type="hidden" name="_wpcf7_locale" value="en_US" />
    <input type="hidden" name="_wpcf7_unit_tag" value="wpcf7-f50-p15-o1" />
    <input type="hidden" name="_wpnonce" value="e147a2b6da" />
    </div>
    <p><label for="name">Name & Surname</label>?<span class="wpcf7-form-control-wrap name"><input type="text" name="name" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" id="name" aria-required="true" aria-invalid="false" /></span></p>
    <p><label for="email">E-mail?Address</label>?<span class="wpcf7-form-control-wrap email"><input type="email" name="email" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-email wpcf7-validates-as-required wpcf7-validates-as-email" id="email" aria-required="true" aria-invalid="false" /></span></p>
    <p><label for="number">Contact Number</label>?<span class="wpcf7-form-control-wrap number"><input type="tel" name="number" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-tel wpcf7-validates-as-tel" id="number" aria-invalid="false" /></span></p>
    <p><label for="subject">Subject</label>?<span class="wpcf7-form-control-wrap subject"><input type="text" name="subject" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" id="subject" aria-required="true" aria-invalid="false" /></span></p>
    <p><label for="message">Message</label><br/><span class="wpcf7-form-control-wrap message"><textarea name="message" cols="42" rows="9" class="wpcf7-form-control wpcf7-textarea wpcf7-validates-as-required" id="message" aria-required="true" aria-invalid="false"></textarea></span></p>
    <p><input type="submit" id="send" name="send" value="SEND" /></p>
    <div class="wpcf7-response-output wpcf7-display-none"></div></form></div>

    I also have this in my functions.php:

    define('WPCF7_AUTOP', false);

    Why is it still adding the <p> tag around my Submit button?

    https://www.ads-software.com/plugins/contact-form-7/

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

    (@takayukister)

    Use [submit] instead of input.

    Thread Starter jbx

    (@jbx)

    @takayuki Thanks, I was setting it in the functions.php file and it needs to be in wp-config.php. It worked now.

    Would be good if it was possible to put it in functions.php because this is something presentation related, and would be good to have control over it from the theme rather than the global wordpress config.

    @aibrean The reason I used <input> directly instead of [submit] is because the latter was adding stuff I didn’t want, like that animated gif, which was breaking all the padding of my design.

    My point was to try it to see if it still wraps. I didn’t realize you were putting the autop in the wrong file though. That would make a difference ?? I typically also strip CF7 CSS from loading so I’ve never seen the rotating gif.

    JustCasey76

    (@justcasey76)

    define(‘WPCF7_AUTOP’, false); goes in the wp-config.php file and NOT the functions.php file.

    Control of this plug-in should not be in the wp-config.php file. That file controls the WordPress install not the theme or plug-ins.

    This option should be moved to a setting in the plug-in or read from the functions.php file.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Why is Contact Form 7 inserting p tags around my fields?’ is closed to new replies.