Simple question about codes, please help.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Sender

    Simple question about codes, please help.

    HI folks. I was wondering. In using forms with javascript, I noticed that
    you can create a new line in a multiline text box using the escape code
    '\r'. Does anyone know where I could find a list of all of these such codes?

    Also, is it possible to change the font or other attributes of the text in
    the form boxes?

    TIA
    Bill


  • Lasse Reichstein Nielsen

    #2
    Re: Simple question about codes, please help.

    "Sender" <blah@blah.co m> writes:
    [color=blue]
    > HI folks. I was wondering. In using forms with javascript, I noticed that
    > you can create a new line in a multiline text box using the escape code
    > '\r'. Does anyone know where I could find a list of all of these such codes?[/color]

    \r inside a Javascript string literal represents the character with
    ASCII number 13 - Carrige Return. You should probably have used \n (ASCII 10,
    Newline).

    The list of all of the possible single-character escape sequences is
    in the ECMAScript standard, section 7.8.4 (String Literals). I copied
    it here:
    ---
    Escape Sequence Code Point Value Name Symbol
    \b \u0008 backspace <BS>
    \t \u0009 horizontal tab <HT>
    \n \u000A line feed (new line) <LF>
    \v \u000B vertical tab <VT>
    \f \u000C form feed <FF>
    \r \u000D carriage return <CR>
    \" \u0022 double quote "
    \' \u0027 single quote '
    \\ \u005C backslash \
    ---
    The "Code Point" is the corresponding value of the character in the
    Unicode encoding, also written as a string escale (backslash - u -
    four hex digits).
    [color=blue]
    > Also, is it possible to change the font or other attributes of the text in
    > the form boxes?[/color]

    That is browser dependent. You can try using CSS.
    <style type="text/css">
    textarea {font-family: sans-serif;color:red ;}
    </style>

    /L
    --
    Lasse Reichstein Nielsen - lrn@hotpop.com
    DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
    'Faith without judgement merely degrades the spirit divine.'

    Comment

    • dlbjr

      #3
      Re: Simple question about codes, please help.

      Use CSS to style the contents

      --
      dlbjr

      Unambit from meager knowledge of inane others,
      engender uncharted sagacity.


      Comment

      • David Dorward

        #4
        Re: Simple question about codes, please help.

        dlbjr wrote:
        [color=blue]
        > Use CSS to style the contents[/color]

        Since when did JavaScript triggered native dialog boxes support CSS?

        --
        David Dorward <http://dorward.me.uk/>

        Comment

        • David Dorward

          #5
          Re: Simple question about codes, please help.

          David Dorward wrote:
          [color=blue]
          > dlbjr wrote:
          >[color=green]
          >> Use CSS to style the contents[/color]
          >
          > Since when did JavaScript triggered native dialog boxes support CSS?[/color]

          OK, the comment actually makes sense when taken in context of the second
          (unrelated to the subject) part of the original comment.

          This is why its useful to _quote_ relevent material when responding on
          Usenet.

          --
          David Dorward <http://dorward.me.uk/>

          Comment

          • Sender

            #6
            Re: Simple question about codes, please help.

            Thanks very much

            Bill


            Comment

            • Michael Winter

              #7
              Re: Simple question about codes, please help.

              David Dorward wrote on 21 Dec 2003 at Sun, 21 Dec 2003 16:45:21 GMT:
              [color=blue]
              > dlbjr wrote:
              >[color=green]
              >> Use CSS to style the contents[/color]
              >
              > Since when did JavaScript triggered native dialog boxes support CSS?[/color]

              Unless I missed something, the OP is asking about form controls, not
              dialog boxes.

              Mike

              --
              Michael Winter
              M.Winter@blueyo nder.co.invalid (replace ".invalid" with ".uk")

              Comment

              Working...