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 :)
[Back to original message]
|