[Javascript] Checking Radio Boxes with a loop

David Dorward david at dorward.me.uk
Mon Feb 16 09:36:24 CST 2009


David Stoltz wrote:
> Thanks all! I see there are many solutions! This is the one I went with:
> 
> 		for(i=1;i<34;i++)
> 		eval("form1.question" + i + "[0].checked=true");
> 
> Again, thanks for all the quick responses!

Don't use that one.

http://www.javascripttoolbox.com/bestpractices/#eval


-- 
David Dorward                               <http://dorward.me.uk/>



More information about the Javascript mailing list