I am trying to do some text field validation before the autocomplete query results for the entered text. My code is:
<script type="text/javascript" src="/scripts/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="/scripts/jquery-ui-1.8.2.min.js"></script>
<script type="text/javascript">
$(function() {
$("#vnu").autocomplete({
source: "url",
minLength: 1,
delay:200,
focus: function (event, ui) {
$(event.target).val(ui.item.label);
return false;
}
});
});
</script>
<body>
<input type="text" name="vnu" id="vnu" />
</body>
Therefore, when someone enters text in a field, I want to check the valid format before Autocomplete asks for a search for results. I already have a function that returns true all false, I'm just not sure where to call it.
source
share