NYCPHP Meetup

NYPHP.org

[nycphp-talk] Javascript and PHP arrays (Massive Redux)

Brian Kaney brian at vermonster.com
Thu Jul 29 13:39:33 EDT 2004


I recommend using Josh's recommendation (i.e. the getElementBy*
methods), and follow the standards-compliant DOM:
http://www.w3.org/DOM/  

Not to pontificate standards compliance...but from my experience this
will make you code less brittle, especially across different browsers
and browser versions.

-Brian



On Thu, 2004-07-29 at 13:27, Chris Bielanski wrote:
> Ah, yeah I put this one to bed with the help of some crazy Scandinavian...
> ;)
> 
> I was neglecting the trailing array subscript. The solution is now:
> 
> alert(document.form.elements["elemName[]"][N].value); 
> 
> displays the Nth value (zero-based) named "elemName[]" out of the form.
> 
> Thanks,
> Chris Bielanski
> Web Programmer, 
> International Trademark Association,
> 1133 Avenue of the Americas, 33rd Floor
> New York, NY 10036
> +1 (212) 642-1745, f: +1 (212) 768-7796
> mailto:cbielanski at inta.org, www.inta.org  
> INTA -- 125 Years of Excellence
> 
> 
> 
> > -----Original Message-----
> > From: Joshua Glenn [mailto:wheelie at acedsl.com]
> > Sent: Thursday, July 29, 2004 1:19 PM
> > To: NYPHP Talk
> > Subject: RE: [nycphp-talk] Javascript and PHP arrays (Massive Redux)
> > 
> > 
> > I just came across the same problem and solved it buy using
> > getElementById().
> > 
> > ie:
> > <name="array[]" id="array">
> > 
> > -josh
> > 




More information about the talk mailing list