NYCPHP Meetup

[nycphp-talk] HTML Javascript Php Arrays

Michele Waldman mmwaldman at nyc.rr.com
Tue Aug 18 22:58:39 EDT 2009


I'm trying to dynamically create an array in javascript to pass to php.

 

This works in FF, but not IE 7.  Does anyone know how to make this work in
IE?

 

            var inp = document.createElement("input");

            inp.type = "text";

            inp.name = "city[]";

            inp.id = "city0";

            inp.value = "Houston";

            document.getElementById('theDiv').appendChild(inp);

 

document.getElementById("city0").length -> 1

document.getElementsByName("lcity[]").length -> 0

 

Michele

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20090818/0c716fda/attachment.html>


More information about the talk mailing list