Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Javascript] Form with array like structure
- From: stevec at topdogstrategy.com (Steve Clason)
- Subject: [Javascript] Form with array like structure
- Date: Sun Jul 23 16:51:33 2006
Peter Lauri wrote:
> I have a form that looks something like this:
>
> <form>
> <input type="text" name="thename[]"/>
> <input type="text" name="thename[]"/>
> <input type="text" name="thename[]"/>
> </form>
>
> In regular case, I can use document.getElementByName("thename").value to
> check the value of it, but how do I do now when one name has several. In PHP
> it is treated as an array, but how can I look thru this with JavaScript?
document.getElementsByTagName("input") will get you an array of input
elements and you can loop through them looking for what you need.
I hope that helps some.
--
Steve Clason
Web Design & Development
Boulder, Colorado, USA
www.topdogstrategy.com
(303)818-8590
- Follow-Ups:
- [Javascript] Form with array like structure
- From: Peter Lauri
- [Javascript] Form with array like structure
- References:
- [Javascript] Form with array like structure
- From: Peter Lauri
- [Javascript] Form with array like structure
- Prev by Date: [Javascript] Form with array like structure
- Next by Date: [Javascript] Form with array like structure
- Previous by thread: [Javascript] Form with array like structure
- Next by thread: [Javascript] Form with array like structure
- Index(es):