JCH-
Its abit hard to tell you what the problem might be without taking a peek at the rest of the code, and especially the output...what "CD" actually equals after that statement.
Try posting abit more information here and help will come easier. I often find that on my way to making a complete post I find the solution to my problem.
In the mean time, here are some debugging tips for you. These are very very helpful if used wisely.
Simplify each statement as much as possible so that you can isolate the problem to one specific area of the statement. In this case, I would start by taking out the escape() method calls and checking the output of the form input boxes.
Space in periodic alert boxes so that you can keep up with your variables. If you have done any other programming and debugging this is kind of like the watch function of most debuggers. Some hints and tips for the alert debugging method:
[ol][li]"\n" makes a newline. ex: "the cat\njumped over the moon"
would print:
the cat
jumped over the moon[/li]
[li]"\t" makes a tab character. very usefull for formatting and structuring the variables you are alerting yourlself to.[/li][/ol]
Keep these simple debugging techniques in mind, they are helpfull.
Robert Carpenter
"You and I have need of the strongest spell that can be found to wake us from the evil enchantment of worldliness." - C.S. Lewis (The Weight of Glory)
robert (at) robertcarpenter (dot) net