梦若夕阳海
穷其一生的追求

引用三级地区的js文件,并在页面对其进行初始化:

 <script type="text/javascript">
        $(function () {

new PCAS("AreaClass1", "AreaClass2", "AreaClass3");

});

页面下拉列表框内容:

 <table>
                        <tr>
                            <td>
                                地区一级:
                            </td>
                            <td>
                                <select id="AreaClass1" name="AreaClass1">
                               </select>
                               
                            </td>
                        </tr>
                        <tr>
                            <td>
                                地区二级:
                            </td>
                            <td>
                                <select id="AreaClass2" name="AreaClass2">
                                </select>
                               
                            </td>
                        </tr>
                        <tr>
                            <td>
                                地区三级:
                            </td>
                            <td>
                                <select id="AreaClass3" name="AreaClass3">
                                </select>
                                
                            </td>
                        </tr>

</table>

若要在加载页面时绑定原先添加时选中过的地区,则可以写成:

new PCAS("AreaClass1", "AreaClass2", "AreaClass3", “@Model.AreaClass1'”, "@Model.AreaClass2", "@Model.AreaClass3");

其中@Model.AreaClass表示从后台获取到的数据

posted on 2012-11-29 11:19  梦若夕阳海  阅读(366)  评论(0编辑  收藏  举报