Home  >  Article  >  Backend Development  >  这回问你们一个比较有难度的有关问题

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

WBOY
WBOYOriginal
2016-06-13 12:26:09943browse

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

<form action="city.php?module=add" method="Post" name='frmdirection' id='frmdirection'><br />	<input type="hidden" name="id" value="{$data.id}" id="uid"/><br />    <table  width="100%" border="0" cellpadding="0" cellspacing="0" class="ttbb2"><br />	<tr  ><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>所属省</strong></td><br />        <td><br />        <select name = "province"   id="parent_one_id"  {if $data.parent_one_id neq '99999'}style="display:block"{else}style="display:none"{/if}><br />          	{foreach from=$province item=item key=index}<br />            <option value="{$item.id}"<br />            {if $item.id eq $data.parent_one_id && $data.parent_one_id neq ""}<br />            selected="selected"<br />            {/if}<br />            >{$item.name} </option><br />            {/foreach}<br /><br />          </select><br />          </td><br />        </tr>  <br />		<br />		<br />        <tr  ><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>所属国家</strong></td><br />        <td><br />        <select name = "country"   id="parent_one_id"  {if $data.parent_one_id neq '99999'}style="display:block"{else}style="display:none"{/if}><br />          	{foreach from=$parent item=item key=index}<br />            <option value="{$item.id}"<br />            {if $item.id eq $data.parent_one_id && $data.parent_one_id neq ""}<br />            selected="selected"<br />            {/if}<br />            >{$item.name} </option><br />            {/foreach}<br /><br />          </select><br />          </td><br />        </tr> <br />		<tr><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>地区/行政区域</strong></td><br />        <td><br />        <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()"/>市<br />        <input type="radio" name="pos_occu" value="1" {if $data.parent_one_id eq '99999'}checked="checked"{/if} onclick="clickRadio()"/>省<br />        <br />         </td><br />        </tr><br />        <tr><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>名称</strong></td><br />        <td><input type ="text"  class="txt150"   name = "name" value="{$data.name}"  id="name"><br />          </td><br />        </tr><br /></table><br /></form>

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn