Forum Moderators: open

Message Too Old, No Replies

Pound signs in forms input fields

         

LordPaul

11:08 am on Apr 10, 2005 (gmt 0)

10+ Year Member



My form is called itemform and Post1st is a text input field...

if I do:

itemform.Post1st.value='£';

the box says: £

so I thought if I do:

itemform.Post1st.value='£';

but the box says: £

Any ideas?

Greven

12:56 pm on Apr 10, 2005 (gmt 0)

10+ Year Member



Haven't testings, but you could try:

\u00A3

I beleive that's the unicode for the pound symbol.

Longhaired Genius

1:07 pm on Apr 10, 2005 (gmt 0)

10+ Year Member



Do you have a charset declaration in the head of the document containing the form? For example:

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">

If so, what is your charset? ISO-8859-1 or UTF-8 or something else?

LordPaul

1:38 pm on Apr 10, 2005 (gmt 0)

10+ Year Member



\u00A3 seemed to work, thanks!

I haven't specified a charset, it was only a page for my own use so I didn't add all these things to the head. Maybe that would have made a difference, too. Thanks as well.

Rambo Tribble

2:32 pm on Apr 10, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yet another approach, that should work, would be to use:

String.fromCharCode(163)

(I guess you could say these are all Sterling examples of character code variants.)