SunTzu Posted October 26, 2006 Share Posted October 26, 2006 Hi everyone,I need your assistance in the following plssssI have a TextArea with a defaule text ( coming from the 'value' attribute) and i want the subsequent text that i will enter to have different color than the default one.Is that possible? and if yes how can i implement such a thing ...thnx in advance Link to comment Share on other sites More sharing options...
aspnetguy Posted October 26, 2006 Share Posted October 26, 2006 I highly doubt that is possible. Link to comment Share on other sites More sharing options...
scott100 Posted October 26, 2006 Share Posted October 26, 2006 Hi everyone,I need your assistance in the following plssssI have a TextArea with a defaule text ( coming from the 'value' attribute) and i want the subsequent text that i will enter to have different color than the default one.Is that possible? and if yes how can i implement such a thing ...thnx in advanceTextarea does not have an attribute "value" input does...examples of both textarea and input<textarea onclick="this.innerHTML='';this.style.color='red'">Default Text</textarea> <input value="Default Text" onclick="this.value='';this.style.color='red'" /> Is that what you wanted? Link to comment Share on other sites More sharing options...
SunTzu Posted October 26, 2006 Author Share Posted October 26, 2006 Textarea does not have an attribute "value" input does...examples of both textarea and input<textarea onclick="this.innerHTML='';this.style.color='red'">Default Text</textarea> <input value="Default Text" onclick="this.value='';this.style.color='red'" /> Is that what you wanted? It is not exactly what i am looking for ... You are right about 'value' Actually i include some text from another form there (this is my default text) and then i want to add some additional text in the area. So, i need this to be with different color.Thak you anyway Link to comment Share on other sites More sharing options...
justsomeguy Posted October 26, 2006 Share Posted October 26, 2006 You can't have more then one text format for an input element. Link to comment Share on other sites More sharing options...
scott100 Posted October 26, 2006 Share Posted October 26, 2006 It is not exactly what i am looking for ... You are right about 'value' Actually i include some text from another form there (this is my default text) and then i want to add some additional text in the area. So, i need this to be with different color.Thak you anyway So you want a textarea to contain text with more than one colour at a time?I don't think you can, you are limited to only one colour AFAIK Link to comment Share on other sites More sharing options...
zachary Posted October 27, 2006 Share Posted October 27, 2006 Well you could probably hook your self up with some javascript script..I'm going to agree with Scott for now. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 27, 2006 Share Posted October 27, 2006 Javascript cannot do that, Javascript just interacts with the DOM or with the element's value or inner or outer HTML, and there's no way with any of those to make text inside of an input element or textarea more then one style. The style property for the element applies to the entire element, not to just selected parts of the value or HTML. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now