Top.Mail.Ru
? ?
Javascript's Journal
 
[Most Recent Entries] [Calendar View] [Friends View]

Sunday, June 4th, 2006

Time Event
2:05p
Changing the colour of part of a text area
I think that this is an example of me flogging a dead horse, but I'll ask anyway:

Is it possible to change the text colour (or, rather, the color) of part, but not all, of a textarea?

I'm using a textarea as field in which a user can enter the body of an SMS message. The length of the message is limited to 138 characters (US Carriers restrict you to 150 per message and you need to have " STOP to end" on the end of it, so 138 it is).

I've been indicating that a person has overrun the maximum message length in two ways. Firstly, by changing the text color to red once the user overruns the limit and then, when the client changed their mind, by truncating the message to the 138 character limit if the user goes over it. Additionally there's a counter under the textarea that tells the user how many characters they have left to play with.

Now the client (curse them) has changed their mind again. Instead of either of the two methods mentioned above (both of which were their idea, by the way) they want any excess text to be red - but only the excess text. Text that is within the 138 character limit should stay black.

So the question again, folks, is: Is this possible? I get the feeling it's not, but I'm not a JavaScript guru.
3:28p
the-name-of-this-file
hello,
maybe it is a lame question, but anyway...
i am making a website in more than one language version and i have put the html files of every version to a separate directory. the names of files are the same in every directory.
now i would like to have links on every page to switch to another version of this page easily. i think about using javascript [written in separate file], if it is possible.
is there a code meaning "the name of this file"? so that i could write "../nameofdesireddirectory/" before it and have a link to the file with the same name but placed in another directory?

could you help me?
thanks in advance! :)

<< Previous Day 2006/06/04
[Calendar]
Next Day >>
About LiveJournal.com
Image