Tweaked the customer similar JS. Now only fires if 3 chars entered

This commit is contained in:
Karl Cordes 2010-03-16 14:51:08 +11:00
parent 625eb8e42a
commit 150cbc7079

View file

@ -10,16 +10,23 @@
$(function() { $(function() {
$("#dialog").hide(); $("#dialog").hide();
/*If the user has entered 3 or more characters. Check to see if its similar to existing customers. */
$("#customerName").change(function () { $("#customerName").change(function () {
$("#dialog").dialog('close'); //Remove any previously opened dialogs if($("#customerName").val().length >= 3) {
$.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) { $.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) {
$("#similarCustList").html(data); $("#similarCustList").html(data);
}); });
$("#dialog").dialog({position: 'right', width: 400}); $("#dialog").dialog({
position: 'right',
width: 400
});
}
}), }),