two dropdown and checkboxes on same page not working
<p>I have to use same checkboxes and dropdowns according to the if condition ,----></p>

<pre><code>&lt;div id="5"  &lt;? if($long_term_rental!=1) {?&gt; style="display:none" &lt;? } else {?&gt;style="display:block" &lt;? } ?&gt;&gt; 
                    &lt;table width="85%" &gt;
                    &lt;tr class="td3"&gt;
&lt;td&gt;City  &lt;/td&gt;
                    &lt;td&gt;&lt;select style="width:100px;" name="citylong" size="1" class="textfeild1" id="citylong"&gt;
                     &lt;option  &lt;? if($citylong=="None")echo "selected='selected'";?&gt;&gt;None&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="Palm Springs")echo "selected='selected'";?&gt;&gt;Palm Springs&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="Cathedral City")echo "selected='selected'";?&gt;&gt;Cathedral City&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="Rancho Mirage")echo "selected='selected'";?&gt;&gt;Rancho Mirage&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="Palm Desert")echo "selected='selected'";?&gt;&gt;Palm Desert&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="La Quinta")echo "selected='selected'";?&gt;&gt;La Quinta&lt;/option&gt;
                      &lt;option &lt;? if($citylong=="Indian Wells")echo "selected='selected'";?&gt;&gt;Indian Wells&lt;/option&gt;
                    &lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;

                  &lt;tr class="td2"&gt;
                  &lt;td align="left"&gt;Upper/Lower/Town House/Single Story&lt;/td&gt;
                    &lt;td align="left"&gt;&lt;select style="width:100px;" name="floorlong" size="1" class="textfeild1" id="floorlong"&gt;
                      &lt;option  &lt;? if($floorlong=="None")echo "selected='selected'";?&gt;&gt;None&lt;/option&gt;
                      &lt;option &lt;? if($floorlong=="Upper")echo "selected='selected'";?&gt;&gt;Upper&lt;/option&gt;
                      &lt;option &lt;? if($floorlong=="Lower")echo "selected='selected'";?&gt;&gt;Lower&lt;/option&gt;
                      &lt;option &lt;? if($floorlong=="TH")echo "selected='selected'";?&gt;&gt;TH&lt;/option&gt;
                     &lt;option &lt;? if($floorlong=="Single Story")echo "selected='selected'";?&gt;&gt;Single Story&lt;/option&gt;
                      &lt;/select&gt;&lt;/td&gt;
                          &lt;/tr&gt;
                           &lt;tr class="td2"&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td &gt;Pets Allowed : &lt;/td&gt;
                    &lt;td &gt;&lt;input class="textfeild1" type="checkbox" name="petslong" id="petslong" value="Pets" &lt;? if($petslong==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;
                    &lt;td&gt;Pool : &lt;/td&gt;
                    &lt;td&gt;&lt;input class="textfeild1" type="checkbox" name="poollong" id="poollong" value="Pool" &lt;? if($poollong==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;
                    &lt;td align="right"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;/tr&gt;
                       &lt;tr class="td2"&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;Jacuzzi  : &lt;/td&gt;
                    &lt;td&gt;&lt;input class="textfeild1" type="checkbox" name="jacuzzilong" id="jacuzzilong" value="Jacuzzi" &lt;? if($jacuzzilong==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;&lt;/div&gt;

And on condition false display the below code----&gt;

&lt;div id="mylng"  &lt;? if($long_term_rental!=1) {?&gt; style="display:block" &lt;? } else {?&gt;style="display:none" &lt;? } ?&gt;&gt; 
                    &lt;table width="100%" &gt;
                    &lt;tr class="td3"&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                     &lt;td&gt;City  &lt;/td&gt;
                    &lt;td&gt;&lt;select style="width:100px;" name="city" size="1" class="textfeild1" id="city"&gt;
                     &lt;option  &lt;? if($city=="None")echo "selected='selected'";?&gt;&gt;None&lt;/option&gt;
                      &lt;option &lt;? if($city=="Palm Springs")echo "selected='selected'";?&gt;&gt;Palm Springs&lt;/option&gt;
                      &lt;option &lt;? if($city=="Cathedral City")echo "selected='selected'";?&gt;&gt;Cathedral City&lt;/option&gt;
                      &lt;option &lt;? if($city=="Rancho Mirage")echo "selected='selected'";?&gt;&gt;Rancho Mirage&lt;/option&gt;
                      &lt;option &lt;? if($city=="Palm Desert")echo "selected='selected'";?&gt;&gt;Palm Desert&lt;/option&gt;
                      &lt;option &lt;? if($city=="La Quinta")echo "selected='selected'";?&gt;&gt;La Quinta&lt;/option&gt;
                      &lt;option &lt;? if($city=="Indian Wells")echo "selected='selected'";?&gt;&gt;Indian Wells&lt;/option&gt;
                    &lt;/select&gt;&lt;/td&gt;
                    &lt;td align="right" style="width: 223px;"&gt;Upper/Lower/Town House/Single Story&lt;/td&gt;
                    &lt;td align="left"&gt;&lt;select style="width:100px;" name="floor" size="1" class="textfeild1" id="floor"&gt;
                     &lt;option  &lt;? if($floor=="None")echo "selected='selected'";?&gt;&gt;None&lt;/option&gt;
                      &lt;option &lt;? if($floor=="Upper")echo "selected='selected'";?&gt;&gt;Upper&lt;/option&gt;
                      &lt;option &lt;? if($floor=="Lower")echo "selected='selected'";?&gt;&gt;Lower&lt;/option&gt;
                      &lt;option &lt;? if($floor=="TH")echo "selected='selected'";?&gt;&gt;TH&lt;/option&gt;
                      &lt;option &lt;? if($floor=="Single Story")echo "selected='selected'";?&gt;&gt;Single Story&lt;/option&gt;
                      &lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;

                      &lt;tr class="td3"&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td &gt;Pets Allowed : &lt;/td&gt;
                    &lt;td &gt;&lt;input class="textfeild1" type="checkbox" name="pets" id="checkbox9" value="Pets" &lt;? if($pets==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;
                    &lt;td&gt;Pool : &lt;/td&gt;
                    &lt;td&gt;&lt;input class="textfeild1" type="checkbox" name="pool" id="checkbox8" value="Pool" &lt;? if($pool==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;
                    &lt;td align="right"&gt;&amp;nbsp;&lt;/td&gt;
                  &lt;/tr&gt;
                       &lt;tr class="td3"&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;Jacuzzi  : &lt;/td&gt;
                    &lt;td&gt;&lt;input class="textfeild1" type="checkbox" name="jacuzzi" id="checkbox6" value="Jacuzzi" &lt;? if($jacuzzi==1) echo "checked='checked'";?&gt;/&gt;&lt;/td&gt;
                     &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                     &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;/tr&gt; 
                      &lt;/table&gt;&lt;/div&gt;
</code></pre>

<p>But the code under <code>&lt;div id="5"</code> is NOT WORKINg and the same code under <code>&lt;div id="mylng"</code> is working PERFECTLY</p>

<p>Please help</p>
