将Ajax Autocompleteextender分配给多个文本字段 [英] Assigning Ajax Autocompleteextender to multiple text fields

查看:104
本文介绍了将Ajax Autocompleteextender分配给多个文本字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨.

我对包含自动完成功能的表单有很大的疑问.该页面是带有c#代码后缀的aspx页面.

表单上有一个地址字段,用户可以在其中输入任何字符串地址.该字段正在使用Ajax自动完成扩展程序,该扩展程序向用户建议路名.效果很好.
此外,用户可以选择在单击按钮时添加多个地址字段.现在可以与Jquery一起正常工作. jQuery复制该表,该表除包含其他字段外,还包含地址字段,并将其粘贴"到现有地址字段的下方.

问题是,如何将Ajax自动完成扩展器附加到要添加的地址字段?还是有其他解决方法可以使所有这些字段都具有此自动完成功能?

这是我的简化代码:

aspx页面:

Hi.

I have quite a problem with a form that contains an autocomplete function. The page is an aspx page with c# codebehind.

On the form there is an address field that the user can type in any string address. This field is using an Ajax autocomplete extender, which suggests roadnames to the user. This works fine.
Furthermore the user has the option to add multiple address fields when clicking a button. This works fine now with Jquery. Jquery copies the table which contains, besides other fields, the address field, and "paste" it underneath the existing adress field.

Problem is, how do I attach the Ajax autocomplete extender to the address fields that gets added? Or is there another workaround to make all these fields have this autocomplete function?

Here is my simplfied code:

aspx page:

<td width="200">
  <asp:textbox id="TextBoxStopRoadName" runat="server" width="200" xmlns:asp="#unknown"></asp:textbox>
    </td>
      <asp:autocompleteextender runat="server" xmlns:asp="#unknown">
        TargetControlID="TextBoxStopRoadName"
        ServicePath="SimaWebWebService.asmx"
        ServiceMethod="GetAddressList"
        MinimumPrefixLength="2"
        EnableCaching="false"
        CompletionInterval="10"
        CompletionSetCount="6" />
</asp:autocompleteextender>




复制地址字段的jQuery代码:




Jquery code that copies the address field:

$("#SingleStop").clone().hide().appendTo("#AllStops").slideDown(200);




真的希望您能提供帮助!

在此先感谢:)




Really hope you can help!

Thanks alot in advance :)

推荐答案

(" ).clone().hide().appendTo( #AllStops" ).slideDown( 200 );
("#SingleStop").clone().hide().appendTo("#AllStops").slideDown(200);




真的希望您能提供帮助!

在此先感谢:)




Really hope you can help!

Thanks alot in advance :)


这篇关于将Ajax Autocompleteextender分配给多个文本字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆