Thread: Javascript help
View Single Post
Old 2006-11-24, 12:53 PM   #1
Useless
Certified Nice Person
 
Useless's Avatar
 
Join Date: Oct 2003
Location: Dirty Undies, NY
Posts: 11,268
Send a message via ICQ to Useless
Javascript help

So I'm working with some borrowed JS and I haven't a clue of what I'm doing with it. Without going way too deeply into the project, let's say that I have a nice little HTML form with three <input> boxes which are named consecutivley "word", "word2" and "word3". When I click on a list of keywords, the first word I click gets inserted in to box "word" by the JS. When I click a second word selection it gets inserted into "word2". What I'd like to do is add to the following JS so I can insert the next word selection into "word3" - but I don't know how to. Please help.


function addWord(keyword) {
if (document.forms[0].word.value == "") {
document.forms[0].word.value = keyword;
} else {
document.forms[0].word2.value += keyword;
}
}

Thanks folks.
Useless is offline   Reply With Quote