PDA

View Full Version : why can't I concatenate?


frank grimes
02-15-2008, 11:33 PM
Hi--

I'm looping through some form fields and need to concatenate their values, but all I get is the last value.

My code:

for (var i=1;i<=document.getElementById("rows").value;i++) {
var url="sanitycheck.php?parts=";

if (eval("document.assemblies.tb_partnum"+i)) {
a=document.getElementById("tb_partnum"+i).value;
url=url+a;
}
}

What's going on?

Thanks for the help...

grimey

A1ien51
02-15-2008, 11:39 PM
Look at your code closely, it is really simple what your problem is. walk through your code mentally and say what is happening out loud.

Eric

frank grimes
02-16-2008, 04:11 AM
Thanks, Eric. It's been a long day and when I saw how stupid I was, I decided to take a break.:o