[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: elements array



Hi Mark,

Mark J. Short wrote:
> 
> To do what you want I would suggest the EVAL
> statement. This should allow you to build the variable name
> on the fly, then interpret it to do your assignment.
> 
> Here is a guess at how to code it
> 
> for (var i = 1; i < 4; i++ {
>    eval("document.FormName.HiddenName"i".value = MyCookieData")
> }

When I use the "HiddenName", it always works, but if I use the elements 
array of the Form, the Problem is there again (sometimes - is it a bug or 
what?)

But maybe "eval" will help me to find out whats going on exactly - thanks 
for the tip!

The funny thing is:

I got:
document.FormName.elements[i].value = Something;

working in some cases, but sometimes I get Messages like:
"value is not a number" (I know that :-))
" is not a numeric literal"
or
"elements can not be index as an array"

But I think in a day or two, I'll have it working :-)

Bye
Olaf


> 
> Please forgive my syntax if it is wrong, I think the method
> is ok._____________________________________________________________________
Olaf Walkowiak, Suedeseestr.14, D-45145 Essen, Phone:+49-201-604594
si0015@aixrs1.hrz.uni-essen.de			OlafWal@aol.com
URL:http://www.bikeconn.de/com/bikeconn/hotel/olaf
_____________________________________________________________________
Request PGP public key by E-Mail
PGP fingerprint: 55 BF 58 7A E9 DC FF 28 33 31 A6 B8 FB A1 28 A6


--------------------------------------------------------------------
This message came from the mailing list javascript. For help using the
mailing list software, please send a message to 'majordomo@obscure.org'
with the message body 'help'. To unsubscribe, send a message to
'majordomo@obscure.org' with the message body 'unsubscribe javascript'.