Link to home
Start Free TrialLog in
Avatar of aej1973
aej1973

asked on

auto complete using jquery...

Hi, I have an autocomplete code as attached. The problem is that it picks up the match anywhere in the string. How can I change the code to pick the match staring from the beginning of the string?

Eg; search 11 needs to pick up 11237 and not 198112. Thank you for the help.

A
<script type="text/javascript">
$().ready(function() {
	
	$("#account").autocomplete("account.php", {
		width: 260,
		matchContains: true,
		mustMatch: true,
		selectFirst: true
	});
	
	$("#account").result(function(event, data, formatted) {
		$("#account").val(data[1]);
	});
});
</script>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of aej1973
aej1973

ASKER

yes, that worked. Thank you very much.

A