Support » Plugins » [Plugin: Contact Form 7] textarea with multi paragraph default

  • Is it possible to have a textarea with default text that includes multiple paragraphs?

    <p><label>Edit the letter:<br />
        [textarea* your-message 24x3 "Dear Senator,
    Please vote no.
    I think our tax money could be better spent in other ways.
    Sincerely," ] </label></p>

    WP inserts <p> and everything becomes a mess. Oddly, the textarea also includes the opening and closing quotes.

    Any suggestions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Does this mean that there is no solution to this problem? I have been searching for hours for some solution to this and have found nothing. Not even anyone saying it can’t be done. Just radio silence.

    Any insight is appreciated.

    I don’t know if this is the best solution, but I’ve found something that works for me. In involves a code change in dd-formmailer.php

    in the function ddfm_gen_widetextarea and/or ddfm_gen_textarea, find the lines that say:

    if ($form_submitted) {
    $gen .= ddfm_bsafe($form_input[$item[‘fieldname’]]);
    } else if (isset($item[‘default’])) {
    $gen .= ddfm_bsafe($item[‘default’]);

    and replace it with something such as this:
    if ($form_submitted) {
    $gen .= str_replace(‘{para}’,”\n\n”,ddfm_bsafe($form_input[$item[‘fieldname’]]));
    } else if (isset($item[‘default’])) {
    $gen .= str_replace(‘{para}’,”\n\n”,ddfm_bsafe($item[‘default’]));

    This does a string replace on the text area text. Wherever you would like a paragraph to show up, you need to put {para} in the configuration for that text area or wide text area.

    I haven’t checked to see if new versions of the plugin have resolved this. I do know, however, that the plugin is otherwise very solid and constantly improving.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Plugin: Contact Form 7] textarea with multi paragraph default’ is closed to new replies.