cmc-sales/php/app/webroot/js/findcustomer.js

54 lines
760 B
JavaScript
Raw Permalink Normal View History

2010-03-17 15:54:12 -07:00
/*
* filename: findcustomer.js
*
* used in: customers/find.ctp
*
2010-03-17 15:54:12 -07:00
*/
$(function() {
$("#dialog").hide();
2010-03-17 15:54:12 -07:00
/*If the user has entered 3 or more characters. Check to see if its similar to existing customers. */
$("#customerName").change(function () {
2010-03-17 15:54:12 -07:00
if($("#customerName").val().length >= 3) {
findCustomer();
}
2010-03-17 15:54:12 -07:00
});
$("#findButton").button().click(function() {
findCustomer();
return false;
});
2010-03-17 15:54:12 -07:00
}
);
function findCustomer() {
$.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) {
$("#similarCustList").html(data);
});
$("#dialog").dialog({
2010-03-29 17:00:28 -07:00
position: 'top',
width: 800
});
}