Re: Javascript/PHP

From: Date: Sat, 24 Aug 2002 01:42:24 +0000
Subject: Re: Javascript/PHP
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-15486@lists.php.net to get a copy of this message
f = document.forms["formname"] for (var i=0;i<f.elements.length;i++) { var e = f[i]; if (e.name = "somename[]") if (e.checked) { }else{ } } or, for (e in f.elements) ... or <input type="checkbox" name="somename[]" onclick="checkElement(this)" /> -- ======================================================================= Michael J. Ryan - tracker1 at theroughnecks dot com Roughneck BBS: http://www.theroughnecks.net telnet://theroughnecks.net ======================================================================= Y!: aztracker1 - aim: azTracker1 - icq: 4935386 - msn: see email One program for aim/icq/yahoo/msn/irc - http://www.trillian.cc/ "Brian 'Bex' Huff" <bex@stellent.com> wrote in message news:3D6500A4.6000605@stellent.com... > > document.myform.elements["somename[]"] > > unless you're having a different problem than Im thinking of... > > -- > > Brian 'Bex' Huff > bex@stellent.com > Phone: 952-903-2023 > Fax: 952-829-5424 > > > I have a javascript function that I am passing a group of checkboxes > > to. The purpose of the js is to check/uncheck all of the boxes for > > various operations to be performed on all of them at the same time. > > That said, the function used to work perfectly when the name of the > > checkbox group was as simple as: > > > > <input type="checkbox" name="somename"... > > > > now I am using the php method of: > > > > <input type="checkbox" name="somename[]"... > > > > the js does not like "somename[]" being passed in as a parameter. > > Any ideas as to how to pass that to the js correctly? > > > > Thanx, Kit --- Synchronet NewsLink v1.00 Beta * Roughneck BBS - www.theroughnecks.net - telnet://theroughnecks.net

« previous php.windows (#15486) next »