-
I have an array , the 3rd item is the name of an object on a page for example like "3_2|Check" how do I access that checkbox by a name I have in a string, so that I Can enable/disable it. This kind of thing has always fustrated me, no matter what language it is in, the reason its in a string to start with is because I created the JS array through ASP.
-
Hi,
If the array is in JavaScript then you can use it's eval function (which, as you quite rightly pointed out, is sadly missed in most other languages.)
example:
Code:
<SCRIPT Language = "JavaScript">
var StrString = "Checkbox1";
var MyObject = eval("document.all.form." + StrString);
MyObject.checked = true;
</SCRIPT>
Hope this helps
Shaun