Results 1 to 3 of 3

Thread: change special html characters in forms

  1. #1
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default change special html characters in forms

    hi

    I have a simple form, which includes a textarea.
    The text that the visitor put into the textarea is being print in my site.
    Sometimes the visitors write signs as " or <

    can I change those signs while sending the form or while it is being print in my site, to the appropriate xhtml vaild codes?

    Thanks

  2. #2
    Join Date
    Jul 2007
    Location
    Azerbaijan, Baku
    Posts
    144
    Thanks
    11
    Thanked 27 Times in 25 Posts

    Default

    use replace().
    like:

    myobject.replace(/</, "&alt");

    Between // is something that we will replace. After it, replace that with this. I think I could help you. If you didn't understand me search in google "javascript replace" or something like that...

  3. The Following User Says Thank You to allahverdi For This Useful Post:

    d-machine (07-14-2008)

  4. #3
    Join Date
    Nov 2007
    Posts
    151
    Thanks
    67
    Thanked 0 Times in 0 Posts

    Default

    Thank you!!!!!
    Last edited by d-machine; 07-14-2008 at 12:27 PM.

Bookmarks

Posting Permissions

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