You need to sign in to do that
Don't have an account?

Autocomplete is not working in visualforce page
Hello,
I have used autocomplete plugin for country field in my VF page. It's not working.
Here's code,
// controller
public class test extends abc
{
@RemoteAction
public static User[] getCityValue()
{
return [Select Id,City From User];
}
}
// VF Page
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script>
var availableTags = new Array();
$(document).ready(function() {
NPORegistration.getCityValue(getCityNames);
});
function getCityNames(result,event)
{
for( var iIndex = 0; iIndex < result.length; iIndex++)
{
var strCity =result[iIndex].City;
if( strCity != null && strCity.length > 0)
availableTags[iIndex] = strCity; // data is getting
}
var elemClientName = $('input[id$=txtCityId]'); // Id is getting
$(elemClientName).autocomplete({source: availableTags , delay: 10});
}
</script>
<td>
<apex:inputText value="{!Reg.BillingCity}" id="txtCityId" />
</td>
Could anybody help me to get through this.
Regards,
Pratty
After going thorugh your code i found
var in for (Var iIndex =0 ...........................)
usually we use integer which are a primitive datatype in apex .
i doubt on var please check with your var.
sorry i didnt observe it is part of script code
Can you provide more details? What's not working? Are there errors? Javascript console give any clues?