WordPress.org

Support

Support » Plugins and Hacks » [Resolved] how to format default text in textarea field

[Resolved] how to format default text in textarea field

  • I have a textarea field “Your address”, and have entered some default text “Street: Suburb: State: Post Code:”, how can I get default text so that each option appears on a new line.

    I tried
    after each item, but it didn’t work.

    I was hoping to reduce the number of fields running down the pages. Thank you.

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • the post didn’t show the code. I tried to enter “br” between each item, to have them appear on new lines, but this didn’t work.

    Plugin Author Mike Challis

    @mikechallis

    I fixed this for the next version.
    Instead of br, use \n for each line break

    Only works for default text of textarea extra fields

    edit:
    si-contact-form-ex-fields.php

    change line 152-153 from:

    if($si_contact_opt['ex_field'.$i.'_default_text'] != '' && ${'ex_field'.$i} == '')
    $string .=  esc_attr($si_contact_opt['ex_field'.$i.'_default_text']);

    to

    if($si_contact_opt['ex_field'.$i.'_default_text'] != '' && ${'ex_field'.$i} == '')
    $string .=  esc_attr(str_replace('\n', "\n", $si_contact_opt['ex_field'.$i.'_default_text']));

    thanks Mike. For some reason wordpress times out every time I try to update the php file. I’ll keep trying though 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] how to format default text in textarea field’ is closed to new replies.