日期:2014-05-16  浏览次数:20547 次

ajax问题。在线结贴。
我有个快速搜索功能。但是通过测试。发现 我输入到文本框的汉字。是乱码。之前曾经用过一个函数转换过 就好用了。但是又忘记是那个函数了。我把大概代码贴出来。大神们来帮帮我 。急


<select name="suppler_id" style="width:100px;">
                                        <option value="0">选择供应商</option>
                                        <?php foreach($suppler_option as $val){?>
                                            <option value="<?php echo $val['id'];?>" <?php if(isset($suppler_id) && $suppler_id==$val['id']){echo 'selected="selected"';}?>><?php echo $val['true_name'];?></option>
                                        <?php }?>
                                    </select>
快速搜索客户:
<input type="text" id="username" size="10px;">
<span id="userdiv">
                                    <select name="user_id" style="width:100px;">
                                        <option value="0">选择客户</option>
                                        <?php foreach($user_option as $val){?>
                                            <option value="<?php echo $val['id'];?>" <?php if(isset($user_id) && $user_id==$val['id']){echo 'selected="selected"';}?>><?php echo $val['true_name'];?></option>
                                        <?php }?>
                                    </select>
</span>