> -----Original Message-----
> From: David D [mailto:[EMAIL PROTECTED]]
> Sent: 13 July 2002 16:38
> 
> I can manage this script to work.
> Js warn about listid[], he doesnt like [] in a var name !
> Php needs them to collect an array from form checkboxes.
> 
> 
> <form name=test action=check.php>
> 
> <input type=button value="partout"
> onClick="this.value=check(this.form.listid[])"><br>

use this.form['listid[]']

It seems to be a very little known fact that, by definition, the JavaScript construct

   x.y

is identical to

   x['y']

so an extended accessor such as

   w.x.y.z

could also be written equally validly in any of the following ways:

   w.x.y['z']
   w.x['y'].z
   w['x'].y.z
   w['x'].y['z']
   w['x']['y'].z

and several other similar combinations!

(And, yes, that means that this['form']['listid[]'] should be valid, too!)

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730      Fax:  +44 113 283 3211 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to