Changed find customer to a dialog with button
This commit is contained in:
parent
d6c6dbc866
commit
b474ecd076
|
|
@ -7,13 +7,16 @@
|
||||||
echo $html->image('system-search.png');
|
echo $html->image('system-search.png');
|
||||||
echo '</h2>';
|
echo '</h2>';
|
||||||
|
|
||||||
echo $form->input('Customer.name', array('Label'=>'Customer Name', 'id'=>'customerName', 'div'=>'ui-widget'));
|
echo $form->input('Customer.name', array('Label'=>'Customer Name', 'id'=>'customerName'));
|
||||||
|
|
||||||
//echo $form->input('Customer.id', array('type'=>'hidden'));
|
//echo $form->input('Customer.id', array('type'=>'hidden'));
|
||||||
|
|
||||||
//echo $form->end('Find');
|
//echo $form->end('Find');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
<div class ="ui-widget">
|
||||||
|
<button id="findButton">Find Customer</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -8,30 +8,46 @@
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
|
|
||||||
$("#dialog").hide();
|
$("#dialog").hide();
|
||||||
|
|
||||||
/*If the user has entered 3 or more characters. Check to see if its similar to existing customers. */
|
/*If the user has entered 3 or more characters. Check to see if its similar to existing customers. */
|
||||||
$("#customerName").change(function () {
|
$("#customerName").change(function () {
|
||||||
|
|
||||||
if($("#customerName").val().length >= 3) {
|
if($("#customerName").val().length >= 3) {
|
||||||
|
findCustomer();
|
||||||
$.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) {
|
|
||||||
$("#similarCustList").html(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$("#dialog").dialog({
|
|
||||||
position: 'center',
|
|
||||||
width: 400
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
})
|
});
|
||||||
|
|
||||||
|
$("#findButton").button().click(function() {
|
||||||
|
|
||||||
|
findCustomer();
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
function findCustomer() {
|
||||||
|
$.post("/customers/similarCustomers", $("#customerName").serialize(), function(data) {
|
||||||
|
$("#similarCustList").html(data);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$("#dialog").dialog({
|
||||||
|
position: 'center',
|
||||||
|
width: 400
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue