[Javascript] Form name?
Peter Brunone
peter at brunone.com
Thu Jun 21 10:03:38 CDT 2001
Anthony,
You mean JavaScript, right? :-)
In order to build object names from strings, you need to use the eval()
function. For example:
var myCategory = eval('document.mainform' + frm + '.Category');
Make sure, of course, that the the Category field exists with that
particular casing, and you should be fine.
Cheers,
Peter
----- Original Message -----
From: "Anthony" <anthony at dreamware.com.au>
To: <javascript at LaTech.edu>
Sent: Thursday, June 21, 2001 9:30 AM
Subject: [Javascript] Form name?
> I have a Java function that modifies a combo box but i wish to chnage the
> name of the form accessed? How do i chnage the form that is accessed? I
wish
> to use the variable frm to specify the form name?
>
> The below function doesn't appear to work!
>
>
> function changeCategory(frm) {
> Category = document.('mainform' + frm).Category; ?????
>
> eg forms are
>
> mainform123
> mainform233
> mainform779
>
>
> _______________________________________________
> Javascript mailing list
> Javascript at LaTech.edu
> http://www.LaTech.edu/mailman/listinfo/javascript
>
More information about the Javascript
mailing list