You are here: Re: PHP array from HTML form checkbox or select « PHP Programming Language « IT news, forums, messages
Re: PHP array from HTML form checkbox or select

Posted by Daniel Tryba on 05/25/05 15:53

RC <raymond.chui@nospam.noaa.gov> wrote:
> But the problem is name="XXX[]" is not standard HTML, right?

No, it's valid HTML according to w3c specs:
http://www.w3.org/TR/html401/interact/forms.html#adef-name-INPUT

> Especial when my HTML file has JavaScript, JavaScript
> treats the name of select or checkbox tag as an array,
> so it doesn't recognized name with []. In JavaScript treats
>
> form.pets[0].value = "cat"
> Can't treats
> form.pets[][0].value = "cat"

That's because you are using [] in it's javascript context (array) while
instead you should be using a literal []: form["pets[]"].value

So readup on your javascript skills :)

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация