input fields and strings

Discussion in 'HTML' started by Tim Fooy, Sep 13, 2004.

  1. Tim Fooy

    Tim Fooy Guest

    Hi all,

    I hope there is a simple solution to this rather trivial problem i can't
    find a solution for.

    Because it's better not to write characters like & and é directly into HTML
    source, i wrote them as the named escape codes & and é The
    strings in which they occur are written as javascript strings. Later i have
    to copy these strings into HTML input text fields. There, they are shown
    literaly, so you see & instead of just &.

    In actual code:
    <script type="text/javascript">
    ar[1] = "one &amp; two";
    document.form.inputtext.value = ar[1];
    </script>

    shows the string "one &amp; two" rather than "one & two" in the input field.

    Is there a way to make the input field show the actual (interpreted) string
    instead of just all the characters that are in the javascript string?

    TIA,

    regs,
    Tim
     
    Tim Fooy, Sep 13, 2004
    #1
    1. Advertising

  2. Tim Fooy

    Black Rose Guest

    The & is good for JavaScript.



    On Mon, 13 Sep 2004 13:13:22 +0200, "Tim Fooy" <>
    wrote:

    >Hi all,
    >
    >I hope there is a simple solution to this rather trivial problem i can't
    >find a solution for.
    >
    >Because it's better not to write characters like & and é directly into HTML
    >source, i wrote them as the named escape codes &amp; and &eacute; The
    >strings in which they occur are written as javascript strings. Later i have
    >to copy these strings into HTML input text fields. There, they are shown
    >literaly, so you see &amp; instead of just &.
    >
    >In actual code:
    ><script type="text/javascript">
    >ar[1] = "one &amp; two";
    >document.form.inputtext.value = ar[1];
    ></script>
    >
    >shows the string "one &amp; two" rather than "one & two" in the input field.
    >
    >Is there a way to make the input field show the actual (interpreted) string
    >instead of just all the characters that are in the javascript string?
    >
    >TIA,
    >
    >regs,
    >Tim
    >
     
    Black Rose, Sep 14, 2004
    #2
    1. Advertising

  3. Tim Fooy

    Tim Fooy Guest

    Yes, but the &amp; is written by another application out of my control. So
    I must reach some kind of interpretation of these escape codes when put in
    an input field.

    "Black Rose" <> wrote:
    > The & is good for JavaScript.
    >
    >
    >
    > On Mon, 13 Sep 2004 13:13:22 +0200, "Tim Fooy" <>
    > wrote:
    >
    > >Hi all,
    > >
    > >I hope there is a simple solution to this rather trivial problem i can't
    > >find a solution for.
    > >
    > >Because it's better not to write characters like & and é directly into

    HTML
    > >source, i wrote them as the named escape codes &amp; and &eacute; The
    > >strings in which they occur are written as javascript strings. Later i

    have
    > >to copy these strings into HTML input text fields. There, they are shown
    > >literaly, so you see &amp; instead of just &.
    > >
    > >In actual code:
    > ><script type="text/javascript">
    > >ar[1] = "one &amp; two";
    > >document.form.inputtext.value = ar[1];
    > ></script>
    > >
    > >shows the string "one &amp; two" rather than "one & two" in the input

    field.
    > >
    > >Is there a way to make the input field show the actual (interpreted)

    string
    > >instead of just all the characters that are in the javascript string?
    > >
    > >TIA,
    > >
    > >regs,
    > >Tim
    > >

    >
     
    Tim Fooy, Sep 14, 2004
    #3
    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. Ben

    Strings, Strings and Damned Strings

    Ben, Jun 22, 2006, in forum: C Programming
    Replies:
    14
    Views:
    767
    Malcolm
    Jun 24, 2006
  2. Chris Carlen
    Replies:
    1
    Views:
    624
    Gabriel Genellina
    Sep 18, 2007
  3. call_me_anything
    Replies:
    4
    Views:
    467
    Pete Becker
    Sep 30, 2007
  4. gotcha
    Replies:
    0
    Views:
    209
    gotcha
    Oct 24, 2003
  5. Replies:
    23
    Views:
    519
    Tim Streater
    Dec 18, 2013
Loading...

Share This Page