Links

Lists

Latest Updates

Ruby On Rails List
Python list
Advanced Java
The JavaScript List
Apache Users
Full Disclosure
Linux Security

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 17:42:30 2006

Peter Lauri wrote:
> Yes that helps, I can see that I have 14 elements and that is correct.
> However, I have not been able to loop thru them? How do I do that? I tried
> the following:
> 
> var inputelements = document.getElementsByTagName("input");
> 
> for(var i=0, len=inputelements.length; i<len; i++) {
> 	document.write(inputelements[i].value+"<br>");	
> }
> 
> But that did not work :/

Try:

var inputelements = document.getElementsByTagName("input");

for(var i=0, i<inputelements.length; i++) {
   document.write(inputelements[i].value+"<br>");	
}

--
Steve Clason
Web Design & Development
Boulder, Colorado, USA
www.topdogstrategy.com
(303)818-8590