By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Simple question about codes, please help.

P: n/a
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
Jul 20 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
"Sender" <bl**@blah.com> writes:
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?
\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).
Also, is it possible to change the font or other attributes of the text in
the form boxes?


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 - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #2

P: n/a
Use CSS to style the contents

--
dlbjr

Unambit from meager knowledge of inane others,
engender uncharted sagacity.
Jul 20 '05 #3

P: n/a
dlbjr wrote:
Use CSS to style the contents


Since when did JavaScript triggered native dialog boxes support CSS?

--
David Dorward <http://dorward.me.uk/>
Jul 20 '05 #4

P: n/a
David Dorward wrote:
dlbjr wrote:
Use CSS to style the contents


Since when did JavaScript triggered native dialog boxes support CSS?


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/>
Jul 20 '05 #5

P: n/a
Thanks very much

Bill
Jul 20 '05 #6

P: n/a
David Dorward wrote on 21 Dec 2003 at Sun, 21 Dec 2003 16:45:21 GMT:
dlbjr wrote:
Use CSS to style the contents


Since when did JavaScript triggered native dialog boxes support CSS?


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

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.