Click here to Skip to main content
15,895,423 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a gridview control...on each add button click i create new row and on each delete button click i delete the last row...in each row there is a text box...in this textbox i wanna autocomplete search...but i get a error...

this is my code:

JavaScript
function automember(eval) {
    alert(eval.value);
    alert(eval.id);

    debugger;
    $(eval.id).autocomplete({
        source: function (request, response) {
            $.ajax({
                type: "POST",
                contentType: "application/json; charset=utf-8",
                url: "/InputSheet.aspx/GetAutoCompleteTour",
                data: "{'selCo':'" + document.getElementById(eval.id).value + "'}",
                dataType: "json",
                success: function (data) {
                    response(data.d);
                },
                error: function (result) {
                    alert("Error");

                }
            });
        }
    });
}


please help me out...
Posted
Updated 4-Dec-13 3:10am
v3
Comments
AlexDpars 4-Dec-13 8:38am    
What is the error you get? You know... If my previous answers helped you you can mark your questions as resolved...
Member 10276220 4-Dec-13 9:06am    
I get "$ is undefined" after "$(eval.id).autocomplete"
Moustafa Safwat 4-Dec-13 9:17am    
I think, JQuery selector couldn't select your control.
you could write id like ---- $("#" + id)
Member 10276220 4-Dec-13 10:08am    
still its not working....

1 solution

Include jQuery in your page. You will resolve the issue.

HTML
<script type="text/javascript" src="Scripts/jquery-1.8.2.js" language="javascript"></script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900