WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Contact Form 7] Auto Inserts Line Break? (25 posts)

  1. freshifreshy
    Member
    Posted 4 years ago #

    I just updated to the newest version of Contact Form 7 and now all my input fields have a <br /> tag inserted before them.

    Does any one else have this problem? I don't want the input field to be on a new line.

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

  2. egjweb
    Member
    Posted 4 years ago #

    you can just manually remove them or not?

  3. freshifreshy
    Member
    Posted 4 years ago #

    No, they don't show up in the editor, only the source code, as if they're a part of the shortcode.

  4. egjweb
    Member
    Posted 4 years ago #

    hmm i have cf7 too, latest version, ill go check, brb

  5. egjweb
    Member
    Posted 4 years ago #

    <p>E-mail:
    info@website.com</p>

    this is how a default inserted field looks at my website.

    (ps. i didnt mean the editor, i meant the contact form 7 admin page)

  6. egjweb
    Member
    Posted 4 years ago #

    pasted wrong code: here's the correct one:

    <p>Email *<br />
    [email* email] </p>
  7. freshifreshy
    Member
    Posted 4 years ago #

    Right, on the contact form 7 admin page the <br /> does not appear. Only in the source code after the form is published.

    Does the line break in your example appear in the contact form 7 admin?

  8. freshifreshy
    Member
    Posted 4 years ago #

    The short code for my email field looks like this [email* your-email] but the code it outputs looks like this:

    <span class="wpcf7-form-control-wrap your-email"><br />
    <input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span>
  9. egjweb
    Member
    Posted 4 years ago #

    yes, the line break appears in the admin page of cf7. when i remove it, i have no break.

    Very strange...

    my output is

    <span class="wpcf7-form-control-wrap your-email"><input type="text" name="your-email" value="" class="wpcf7-validates-as-email wpcf7-validates-as-required" size="40" /></span>

    what version you are using? I just found out im not at the very latest version... thought i was... maybe thats the differance

  10. freshifreshy
    Member
    Posted 4 years ago #

    I'm using version 2.1.1

  11. Takayuki Miyoshi
    Member
    Posted 4 years ago #

  12. freshifreshy
    Member
    Posted 4 years ago #

    Adding define( 'WPCF7_AUTOP', false ); to my config file didn't solve the problem. I still have line breaks inserted before each input field.

  13. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    Can I see the page?

  14. freshifreshy
    Member
    Posted 4 years ago #

    Sorry for the delay. Page is here.

  15. Takayuki Miyoshi
    Member
    Posted 4 years ago #

    See if switching to the default theme would resolve this issue.

  16. Arkantos
    Member
    Posted 4 years ago #

    I have the same problem, this happened after the upgrade to the new version of Contact Form. Now breaks are auto-inserted between the word and field. I mean:

    Before (Good):

    Name:
    [name field here]

    Now (ugly!!!):

    Name:

    [name field here]

    Any solution?

  17. Arkantos
    Member
    Posted 4 years ago #

    I provisionally solved it in a rough way, if you want your form to look like before, just put the fields this way:

    Name: [text* your-name]

    This will show up:

    Name:
    [name field]

  18. freshifreshy
    Member
    Posted 4 years ago #

    Yeah, but what if you don't want a line break at all...

  19. Arkantos
    Member
    Posted 4 years ago #

    That's the f* problem.

  20. freshifreshy
    Member
    Posted 4 years ago #

    Can't recall if there was an update, but I'm not having this problem any more.

  21. Herr Zogg
    Member
    Posted 4 years ago #

    I have the same problem, e.g. here: http://zuerichtennis.vereinsportal.org/turniere-events/kerenzerberg

    I have no idea how to get rid of the br. Anyone else?

  22. starmatt
    Member
    Posted 3 years ago #

    I'm having the same problem. I'm not using the same Contact form plugin, just inserted a search form and can't put the text on the same line as the input tag. Any solutions?

  23. livelearncreate
    Member
    Posted 3 years ago #

    This is really a disappointment from such a great, reliable plugin.

    Why, why, why would they do this? Ok...I understand...they are considering the lowest common denominator—general purpose users-but still at least make it an option (Check here to auto format your form).

    I hope the developers fix this. This is going to compromise a lot of existing sites, right??????

    Here is my workaround:

    .wpcf7-form-control-wrap br {display: none!important;}

    Reason:
    1) Editing the core plugin file will just result in it being overwritten the next time you run the update.

    2) The wp-config.php edit didn't work either, which seems like another issue in and of itself.

    3) I can insert my own <br class="myBreak" /> and make those appear where I want them.

    May be time to look for a better plugin. Suggestions?

    C'est la vie.
    *ian

  24. alhadis
    Member
    Posted 3 years ago #

    I posted about this a few weeks ago.

    The solution I came up with was a serious hack, but there was no other way around it short of editing the plugin's core code. Just stick this somewhere in your theme's functions.php and it should work:

    add_filter("wpcf7_mail_tag_replaced", "suppress_wpcf7_filter");
    function suppress_wpcf7_filter($value, $sub = ""){
    	$out	=	!empty($sub) ? $sub : $value;
    	$out	=	strip_tags($out);
    	$out	=	wptexturize($out);
    	return $out;
    }
  25. alhadis
    Member
    Posted 3 years ago #

    Also note that this is NOT the same issue as not having the "WPCF7_AUTOP" constant defined to FALSE; this issue's a completely different one altogether. The most recent build of the plugin "features" mandatory autop formatting of the submitted post; which means all your field references are going to be broken up line by line, whether you like it or not.

    So something like this:

    Name: [text* first-name] [text* surname]

    Is going to come out looking like this:

    Name:
    Henry
    
    Anderson

    Total pain in the ass.

Topic Closed

This topic has been closed to new replies.

About this Topic