Forum Moderators: open
I am having a syntax problem with Javascript that I'm sure is not my logic.
Ok, I have several html drop down boxes each named Active<%=count%> so the html reads Active1, Active2, Active3 and so on. Each of these drop down boxes has a value of true or false. When the submit button is pressed, I pass in the value of count to a JavaScript function, which goes in correctly. There can only be one true value out of all the drop down boxes. My problem is when I try to check for more than one true value by concatenating a string like so :
if(thisfrm.Active + count.value=="False") {
tripswitch ++;
}
tripswitch is equal to 0, which means it's not being read and if I change ".Active + count" to ".Active1" tripswitch is equal to 2 which is correct. Because the value of count is determined by an unknown amount of recordsets, is there anyway to anchor the count variable onto the field name? Any help is much appreciated.
Thank You,
Sangarius
1. I'd recommend sticking to lower case to avoid problems...anyway
2. You won't be able to concatenate a reference like that:
thisfrm.Active + count.value XXX
but like this
thisfrm.["Active" + count].value
does this help?
------ after ---------------
..or indeed like that!