• Announcements

Archived

This topic is now archived and is closed to further replies.

[java] JavaScript; How would I do this? (simple question)

Recommended Posts

aftermath    100
Hello java aficionados! I have a small questions for you. I appoligize in advance if this JavaScript questions doesnt no fit into the "Java" forum. I have textarea tag pair, and it has text in betwene. What I want to do is 1) check to see if it has text that is _NOT_ all spaces and then 2) if it does have spaces " " then to remove them. If it alreay has text other then spaces like " foo " then I want to trim the spaces off and just leave "foo". I do not know a single bit of javascript, so I would like for someone to just give me a code snipet of how to do this. This is my code to work with: <textarea name="comment" cols="30" rows="6" id="comment"> (spaces, spaces, spaces) </textarea>

Share on other sites
Strife    374
I would''ve expected better from you...

This sounds too much like a homework question to be allowed. Learn some JavaScript and try it out, then if you still need help you can post again with what you have.

http://chaos.webhop.org