How to Avoid Special Character Conversion ?

Discussion in 'Javascript' started by RobertTG, Aug 23, 2005.

  1. RobertTG

    RobertTG Guest

    Value entered in textarea is: "this "TEST" is not going well"

    JS sends to server this value: "this "TEST" is not going well"

    How to force JS not to convert the string ? I want JS to send exactly what
    is typed in the form controls.
    Is there a function to call ?
    Thx
    RobertTG, Aug 23, 2005
    #1
    1. Advertising

  2. RobertTG

    ASM Guest

    RobertTG wrote:
    > Value entered in textarea is: "this "TEST" is not going well"
    >
    > JS sends to server this value: "this "TEST" is not going well"


    yes but inverse convertion would be done automaticaly

    > How to force JS not to convert the string ?


    does it JS who convert the string ?
    do :
    alert(document.form1.myTextarea.value)
    to see
    or your browser ?

    do you use a doctype on your page
    if yes, wich one ?
    do you have a meta caractere-encoding ?
    wich one ?
    try to use a charset-encoding : utf-8

    if JS html-entities encodes your string(*), try :
    text = unescape(document.form1.myTextarea.value)


    (*) I would be very surprised JS converts in html-entities ! ! !

    --
    Stephane Moriaux et son [moins] vieux Mac
    ASM, Aug 23, 2005
    #2
    1. Advertising

  3. RobertTG wrote:

    > Value entered in textarea is: "this "TEST" is not going well"
    >
    > JS sends to server this value: "this "TEST" is not going well"


    What JS code do you use to send something to the server? And what are
    you using on the server to check out the data sent?

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Aug 24, 2005
    #3
  4. RobertTG

    RobertTG Guest

    Thanks ! you're right !
    I cried wolf - turns out it was server-side that performed the escape.

    "ASM"
    > (*) I would be very surprised JS converts in html-entities ! ! !
    RobertTG, Aug 24, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lucky

    Special Character Conversion

    Lucky, Mar 21, 2006, in forum: ASP .Net
    Replies:
    4
    Views:
    512
    Joerg Jooss
    Mar 21, 2006
  2. Alexander Malkis
    Replies:
    8
    Views:
    509
    Alexander Malkis
    Apr 14, 2004
  3. Roger23
    Replies:
    2
    Views:
    987
    Roger23
    Oct 12, 2006
  4. Piet71
    Replies:
    1
    Views:
    485
    Joe Kesselman
    Mar 7, 2007
  5. JJA
    Replies:
    13
    Views:
    293
    John Saunders
    Jul 27, 2004
Loading...

Share This Page