How to pass multiple parameters in autocomplete script
-
I want to pass multiple parameters ( ID and Name ) to the autocomplete script. It works if i put only one parameter but not working with two parameters. This is not working
<script type="text/javascript">function BindEvents() {
$(document).ready(function () {
$("#<%=txtID.ClientID%>")+$("#<%=txtName.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
});
}</script>
This is working
<script type="text/javascript">
function BindEvents() {
$(document).ready(function () {
$("#<%=txtID.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
});
}
</script> -
I want to pass multiple parameters ( ID and Name ) to the autocomplete script. It works if i put only one parameter but not working with two parameters. This is not working
<script type="text/javascript">function BindEvents() {
$(document).ready(function () {
$("#<%=txtID.ClientID%>")+$("#<%=txtName.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
});
}</script>
This is working
<script type="text/javascript">
function BindEvents() {
$(document).ready(function () {
$("#<%=txtID.ClientID%>").autocomplete('../../Common_Search/Employee.ashx');
});
}
</script>That's not creating multiple parameters, that's appending two strings, so the ID that you would be creating would end up looking something like this - __$$txtID__$$txtName (I know, those aren't the actual characters that would be put in, but this is for demonstration) - so, the ID that the JavaScript would be looking for wouldn't exist anywhere on the page (BTW - this question has nothing to do with the .NET framework, you would have been better off posting this in the ASP.NET forum instead).