WordPress.org

Ready to get started?Download WordPress

Forums

Fast Secure Contact Form
[resolved] how to format default text in textarea field (4 posts)

  1. aeime
    Member
    Posted 1 year ago #

    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/

  2. aeime
    Member
    Posted 1 year ago #

    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.

  3. Mike Challis
    Member
    Plugin Author

    Posted 1 year ago #

    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']));
  4. aeime
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic