• Hi,
    Using CF7 3.5.2 on WP 3.6 (but also happened on 3.5.?)

    I’m having a problem with newlines in the placeholder text of multi-line textareas being ignored when the form is rendered.
    I’m afraid I’m not sure when this began happening but it was some time between February 2013 and August 2013.

    I’ve tried disabling all plugins except for CF7, and all stylesheets but it’s made no difference.

    I’ve tested in FireFox 23, Chrome 29 and IE10 on PC, and Safari on iOS 6.1.3 – of these, only IE10 displays the linebreaks.

    I suspect it’s because the way the placeholder (formerly watermark) is generated has changed with the switch to html5 elements (html5 input placeholder attributes do not allow newlines – http://www.w3.org/TR/2012/WD-html5-20121025/common-input-element-attributes.html#the-placeholder-attribute ).

    In the Contact Form editor, the relevant item is:

    [textarea your-address 40x5 placeholder]123 Your Street,
    Your Town,
    Your City,
    Your County[/textarea]

    which becomes as follows in the html source:

    <textarea name="your-address" cols="40" rows="5" class="wpcf7-form-control wpcf7-textarea" placeholder="123 Your Street,
    Your Town,
    Your City,
    Your County"></textarea>

    and displays in the rendered textarea as the placeholder:
    123 Your Street,Your Town,Your City,Your County

    Other variations I’ve tried are:

    [textarea your-address 40x5 placeholder]123 Your Street,\nYour Town,\nYour City,\nYour County[/textarea]

    which becomes

    <textarea name="your-address" cols="40" rows="5" class="wpcf7-form-control wpcf7-textarea" placeholder="123 Your Street,\nYour Town,\nYour City,\nYour County"></textarea>

    and displays as the placeholder:
    123 Your Street,\nYour Town,\nYour City,\nYour County

    and:

    [textarea your-address 40x5 placeholder "123 Your Street,\nYour Town,\nYour City,\nYour County"]

    which becomes:

    <textarea name="your-address" cols="40" rows="5" class="wpcf7-form-control wpcf7-textarea" placeholder=""123 Your Street,
    Your Town,
    Your City,
    Your County""></textarea>

    and displays as the placeholder:
    "123 Your Street,Your Town,Your City,Your County"

    If, as I’m guessing, this is due to the W3c html5 implementation of placeholders, is there anything I can do to revert to the old behaviour?

    Many thanks

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

  • The topic ‘Newlines in textarea placeholder text ignored when form is rendered (html5?)’ is closed to new replies.