<br><br><div class="gmail_quote">On Wed, Aug 19, 2009 at 5:58 AM, Michele Waldman <span dir="ltr">&lt;<a href="mailto:mmwaldman@nyc.rr.com">mmwaldman@nyc.rr.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">












<div link="blue" vlink="purple" lang="EN-US">

<div>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">I’m trying to dynamically create an array in
javascript to pass to php.</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">This works in FF, but not IE 7.  Does anyone know how
to make this work in IE?</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
var inp = document.createElement(&quot;input&quot;);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
inp.type = &quot;text&quot;;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
<a href="http://inp.name" target="_blank">inp.name</a> = &quot;city[]&quot;;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
<a href="http://inp.id" target="_blank">inp.id</a> = &quot;city0”;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
inp.value = “Houston”;</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">           
document.getElementById(&#39;theDiv’).appendChild(inp);</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">document.getElementById(&quot;city0”).length -&gt; 1</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">document.getElementsByName(&quot;lcity[]&quot;).length -&gt;
0</span></font></p>

<p><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;"> </span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;">Michele</span></font></p>

<p><font face="Times New Roman" size="3"><span style="font-size: 12pt;"> </span></font></p>

</div>

</div>


<br>_______________________________________________<br>
New York PHP User Group Community Talk Mailing List<br>
<a href="http://lists.nyphp.org/mailman/listinfo/talk" target="_blank">http://lists.nyphp.org/mailman/listinfo/talk</a><br>
<br>
<a href="http://www.nyphp.org/show_participation.php" target="_blank">http://www.nyphp.org/show_participation.php</a><br></blockquote></div><br>Shouldn&#39;t <font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">document.getElementById(&quot;city0”).length be </span></font><font face="Arial" size="2"><span style="font-size: 10pt; font-family: Arial;">document.getElementById(&quot;city0”).value.length ?<br>
Also, you should look into creating a json string, send it to php and use json_decode on the php side. If what you&#39;re looking for is sending arrays to php. But I&#39;m not sure you&#39;re thinking of the same thing looking at your example.<br clear="all">
</span></font><br>-- <br>Numai bine,<br>Cristian<br>