数据库三级联动如何做

WBOY
풀어 주다: 2016-06-13 12:25:45
원래의
987명이 탐색했습니다.

数据库三级联动怎么做

   这么做到选择国家的时候省市和市区显示  选择市区的时候出现省市和国家的选择  。   

<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 /><br />		<tr><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>地区/行政区域</strong></td><br />        <td><br />		<input type="radio" name="pos_occu" value="2" {if $data.parentid eq "" or $data.parentid neq "99999"}checked="checked"{/if}  onclick="clickRadio()"/>地区<br />        <input type="radio" name="pos_occu" value="0" {if $data.parentid eq "" or $data.parentid neq '99999'}checked="checked"{/if}  onclick="clickRadio()"/>省份<br />        <input type="radio" name="pos_occu" value="1" {if $data.parentid 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 = "data[name]" value="{$data.name}"  id="name"><br />          </td><br />        </tr><br />        <tr  ><br />        <td width="40%" align="right" bgcolor="#e9f4ff"><strong>所属国家</strong></td><br />        <td><br />        <select name = "data[parentid]"   id="parentid"  {if $data.parentid neq '99999'}  style="max-width:90%"{else}style="display:none"{/if}><br />          	{foreach from=$parent item=item key=index}<br />            <option value="{$item.id}"<br />            {if $item.id eq $data.parentid && $data.parentid 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 />        <select name = "data[parentid]"   id="parentid"  {if $data.parentid 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.parentid && $data.parentid neq ""}<br />            selected="selected"<br />            {/if}<br />            >{$item.name} </option><br />            {/foreach}<br /><br />          </select><br />          </td><br />        </tr>  <br /></table><br /></form><br />
로그인 후 복사

------解决思路----------------------
没明白 你想干什么 
是数据库设计不好 
还是代码不会写

관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!