0

I want To Implement AutoComplete Functionality On Telerik TextBox [RadInput] Using Jquery And Web Service.When I enter Any Character, I receive relative Suggestion From Database. This All Works Fine If i Use Simple ASP Textbox. It doesn't Work With RadTextBox.

Any Idea Why This Happens ?

Please Don't Provide Me This Link Of RadComboBox http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/autocompleteclientside/defaultcs.aspx I only Want To Use RadTextBox.

Thanks In Advance..

Pratik Bhatt

1 Answer 1

1

I've used this before with success -

http://www.dotnetcurry.com/ShowArticle.aspx?ID=515

I just modified the script slightly, as follows -

$(function() {
    $(".tb").autocomplete({
        source: function(request, response) {
            $.ajax({
                url: "EmployeeList.asmx/FetchEmailList",
                data: "{ 'mail': '" + request.term + "' }",
                dataType: "json",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                dataFilter: function(data) { return data; },
                success: function(data) {
                        response($.map(data.d, function(item) {
                            return {
                                Cost: item.Cost //***
                            }
                        }))
                    },
                select: function( event, ui ) {
        $find("<%= RadTextBox1.ClientID %>").set_value(ui.item.Cost); //***
            },
                error: function(XMLHttpRequest, textStatus, errorThrown) {
                    alert(textStatus);
                }
            });
        },
        minLength: 2
    });
});

I've marked the lines of interest with //* * *

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

2 Comments

Hello Sir! As You Have Helped Me By Showing Code, I have Tried To Implement But Was Not Succeed. Can You Please Gide Some More Because I am not So Much Experienced Developer.
Sure, can you provide the code you have tired so far, as I'll see if I can see where things are going wrong.

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.