dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Textarea not rendering apostrophes correctly

  1. #1
    Join Date
    Aug 2011
    Posts
    63

    Textarea not rendering apostrophes correctly

    Hi all,

    I have a contact form, and for the textarea anytime someone writes a word containing an apostrophe, it renders it as an html character code - \'

    So If someone were to type: Hello I'm Sergio - I would get in my email: Hello I\'m Sergio.

    Does it have anything to do with htmlspecialchars? Or is it something else?
    This is for a wordpress site, and the textarea code is as follows:
    HTML Code:
    <textarea rows="10" cols="39" name="cf-message" required>' . ( isset( $_POST["cf-message"] ) ? esc_attr( $_POST["cf-message"] ) : '' ) . '</textarea>
    Thanks so much for any input.

    Sergio

  2. #2
    Join Date
    Aug 2011
    Posts
    63
    Sorry, I meant to say - it renders it as an html character code -
    HTML Code:
    \&#039;
    Thank you.

  3. #3
    Join Date
    Dec 2007
    Location
    Kelowna, BC
    Posts
    114
    Hi there!

    This may shed some light on it, as it sounds like an "escape method" in your textarea, which of course, is executing special characters into their original coding (in other words, in reverse of what you would code special characters in .. &amp; etc.)

    https://github.com/impresspages/Impr...d/Textarea.php

    Hope this is a decent starting point?

    Kind Regards,
    Cal
    Visiting or Relocating to the Okanagan Valley...
    http://www.okanaganforum.com/forum

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles