当前位置: 代码迷 >> PHP >> 这回问你们一个比较有难度的有关问题
  详细解决方案

这回问你们一个比较有难度的有关问题

热度:22   发布时间:2016-04-28 16:54:33.0
这回问你们一个比较有难度的问题,
<form action="city.php?module=add" method="Post" name='frmdirection' id='frmdirection'>
<input type="hidden" name="id" value="{$data.id}" id="uid"/>
    <table  width="100%" border="0" cellpadding="0" cellspacing="0" class="ttbb2">
<tr  >
        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>所属省</strong></td>
        <td>
        <select name = "province"   id="parent_one_id"  {if $data.parent_one_id neq '99999'}style="display:block"{else}style="display:none"{/if}>
           {foreach from=$province item=item key=index}
            <option value="{$item.id}"
            {if $item.id eq $data.parent_one_id && $data.parent_one_id neq ""}
            selected="selected"
            {/if}
            >{$item.name} </option>
            {/foreach}

          </select>
          </td>
        </tr>  


        <tr  >
        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>所属国家</strong></td>
        <td>
        <select name = "country"   id="parent_one_id"  {if $data.parent_one_id neq '99999'}style="display:block"{else}style="display:none"{/if}>
           {foreach from=$parent item=item key=index}
            <option value="{$item.id}"
            {if $item.id eq $data.parent_one_id && $data.parent_one_id neq ""}
            selected="selected"
            {/if}
            >{$item.name} </option>
            {/foreach}

          </select>
          </td>
        </tr> 
<tr>
        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>地区/行政区域</strong></td>
        <td>
        <input type="radio" name="pos_occu" value="0" {if $data.parent_one_id eq "" or $data.parent_one_id neq '99999'}checked="checked"{/if}  onclick="clickRadio()"/>市
        <input type="radio" name="pos_occu" value="1" {if $data.parent_one_id eq '99999'}checked="checked"{/if} onclick="clickRadio()"/>省
        
         </td>
        </tr>
        <tr>
        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>名称</strong></td>
        <td><input type ="text"  class="txt150"   name = "name" value="{$data.name}"  id="name">
          </td>
        </tr>
</table>
</form>

如代码  两个按钮一个市  一个省 代码实现了点击市的时候所属省和所属国家同时出现  点击省只出现国家 是连接数据库输出数值的。 问题是数值没有分类也就是有所属省的时候省就全部都出来了 不论选择哪个国家。 即是说正常是:中国-辽宁   现在可能是:中国-纽约  差一个判断语句 怎么改,  在原代码上加js jquery可以 但是原判断语句不动。 有没有会的
------解决思路----------------------
应在php控制数据输出,不应该在获取php数据后再判断。
------解决思路----------------------
古人云:我弱我有理
楼主我顶你
那些回答问题的一看就都不是好人
  相关解决方案