|
-
Oct 12th, 2000, 10:18 AM
#1
Thread Starter
Addicted Member
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.
-
Oct 26th, 2000, 01:14 PM
#2
Addicted Member
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
Web/Application Developer
VB6 Ent (SP5), Win 2000,SQL Server 2000
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|