0

Does asp ajaxtoolkit autocomplete combobox have some javascript functions available, so we could select selecteditem text or selected item value in client side.

Thanks Atif

2 Answers 2

1

If you mean this, here you can download the complete source code with all js files:

http://ajaxcontroltoolkit.codeplex.com/

Otherwise, here is a short documentation:

http://www.asp.net/ajax/ajaxcontroltoolkit/samples/autocomplete/autocomplete.aspx

I think, you can control this behaviour through the completion service method, where is up to you, how you implement it.

Sign up to request clarification or add additional context in comments.

Comments

0
<script type="text/javascript">
    function autoComplete1_OnClientShown(sender, eventArgs) {
        var valueToSelect = $("#<%= TextBox1.ClientID  %>").val();

        if (valueToSelect.length > 0) {
            var itemToSelect = $("li[_value^='" + valueToSelect + "']", ".CompletionList").get(0);
            Sys.Debug.traceDump(itemToSelect);
            if (itemToSelect)
                $find("AutoCompleteEx")._setText(itemToSelect);
        }
    }
</script>

<asp:Label runat="server" AssociatedControlID="TextBox1" Text="Select the first value that starts with: " />
    <asp:TextBox runat="server" ID="TextBox1" />&nbsp;
    <br />
    <asp:Label ID="Label1" runat="server" AssociatedControlID="TextBox2" Text="Choose value: " />
    <asp:TextBox runat="server" ID="TextBox2" />
    <ajax:AutoCompleteExtender runat="server"
            BehaviorID="AutoCompleteEx"
            ID="autoComplete1" 
            TargetControlID="TextBox2"
            ServicePath="Default.aspx" 
            ServiceMethod="GetCompletionList"
            MinimumPrefixLength="2" 
            DelimiterCharacters=";, :"
            CompletionListCssClass="CompletionList"
            OnClientShown="autoComplete1_OnClientShown"
            ShowOnlyCurrentWordInCompletionListItem="false" >
     </ajax:AutoCompleteExtender>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.