|
FineUI 4.1.4 里面 用了 AutoComplete,现在有个问题,就是无法获取页面下拉列表的值。本人是想传递两个参数给ashx文件,第一个是下拉列表的选取项的值,第二个是文本框里面输入的关键字,然后进行补全,但是怎么都无法得到下拉列表的值,总是显示 undefined,代码在下面,哪位大神给看看,谢谢了。
- <f:DropDownList runat="server" ID="ddl_city" Label="所属地区" Required="true" ShowRedStar="false"
- BoxFlex="2" CompareValue="0" CompareOperator="NotEqual" CompareMessage="请选择城市"
- EnableEdit="true" ForceSelection="true" OnSelectedIndexChanged="ddl_city_changed">
- </f:DropDownList>
- <%--<f:HiddenField runat="server" ID="hf_cityID"></f:HiddenField>--%>
- <f:TextBox runat="server" ID="tb_cityID" Hidden="true"></f:TextBox>
- <f:TextBox runat="server" Label="采血医院" ID="tb_hospital" Required="true" ShowRedStar="false"
- BoxFlex="2" RequiredMessage="采血医院不能为空 或者 采血医院名称不匹配" OnBlur="tb_hospital_changed"
- EnableBlurEvent="true">
- </f:TextBox>
复制代码- </f:Panel>
- </form>
- <%--<script src="../res/js/jquery-1.10.2.js" type="text/javascript"></script>
- <script src="../res/js/jqueryui/js/jquery-ui-1.9.2.custom.js" type="text/javascript"></script>--%>
- <script src="../res/jqueryautocomplete/jquery.min.js" type="text/javascript"></script>
- <script src="../res/jqueryautocomplete/jquery-ui.min.js" type="text/javascript"></script>
- <script type="text/javascript">
- var textbox1ID = '<%= tb_hospital.ClientID %>';
- F.ready(function () {
-
- var cache = {};
- $('#' + textbox1ID + ' input').autocomplete({
- selectFirst: true,
- autoFill: true,
- minLength: 0,
- scroll: true,
- mustMatch: true,
- scrollHeight: 300,
- matchContains: true,
- source: function (request, response) {
- var term = request.term;
- if (term in cache) {
- response(cache[term]);
- return;
- }
- $.getJSON("../AutoComplete/autocomplete.ashx", request, function (data, status, xhr) {
- cache[term] = data;
- response(data);
- });
- }
- });
- });
- </script>
- </body>
- </html>
复制代码 Jquery 直接加个参数,然后设置选中项的值总是不对,显示 undefined,$.getJSON("../AutoComplete/autocomplete.ashx?cityID=" + $("#ddl_city").val(), request, function (data, status, xhr)
|
|