Forum Moderators: open
If you are reading the messages out of the mysql, you have to be reading out code to the browser. So add in the definition to color the text as CSS.
definedcolor1
definedcolor2
definedcolor3
etc
<span class="definedcolor<? echo $loopvariable;?>"><? echo $message;?></span>
make sure you do your change to the loopvariable within each loop though the database to get the differeent definedcolor# styles for each one.
The possibilities are code endless, what I just mention is only way sort of way to complete the task.
Can you code PHP?
I can use php.
The trouble is, you cant use <span> or any code within the text area as it is just plain text and the code just gets outputed to the textarea. What i need is a rich text area or something. You can only change the overall text color of the text area, not individual elements.
Someone suggested java on another forum but i just need a simple screen for 2 users to message each other and java is a bit overkill. Are there any html and php workarounds?
Thanks again
<textarea style="color: red; font-family: arial;">This is the text in the textarea. Note the color and font.</textarea>
However, I use scrolling DIVs for this job unless you intend to allow the user to edit the textarea. Scrolling DIVs allows formatting within the content but textarea does not.
Does this help?
The way you done it only changes the over all text style and not individual messages.
I really dont think its possible with textarea and i've never heard of scrolling divs until now and a quick google shows you've found what i'm after :)
Cheers, scrolling divs are exactly what i needed :)
Thankyou!
My MySQL app uses scrolling DIVs massively. SQL query results are shown in a scrolling table with dynamically sized and scrolled headers.
I let a TABLE lay out the results grid, then use Javascript with CSS to set the position and widths of the left-right auto scrolling headers. Then more javascript scrolls the headers when the table scrolling DIV is scrolled by the user.
Even more Javascript resizes the scrolling DIV to fill the browser window when the user resizes the window.
Finally, I actually load the content of a scrolling DIV dynamically without reloading the whole page. This is all done with HTML and client side Javascript. It keeps the page as light as possible. Something like 52% use analog modem.
HTH,
Webheavy