Created
March 16, 2014 23:27
-
-
Save axilaris/9591377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).ready -> | |
| state_cache = {} | |
| $('#invoice_product_code_invoice_product_code').change -> | |
| invoice_product_code = $(this).val() | |
| console.log invoice_product_code | |
| switch invoice_product_code | |
| when 'INVPRODA' | |
| $('#product_name').val('Product A'); | |
| when 'INVPRODB' | |
| $('#product_name').val('Product B'); | |
| when 'Add New' | |
| $("#invoice_product_code_invoice_product_code").val('INVPRODA'); | |
| $('#windowCreateInvoiceProductDialog').modal("show"); | |
| else | |
| $('#product_name').val('Something') ; | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$(document).ready(function() {
var state_cache;
state_cache = {};
return $('#invoice_product_code_invoice_product_code').change(function() {
var invoice_product_code;
invoice_product_code = $(this).val();
console.log(invoice_product_code);
switch (invoice_product_code) {
case 'INVPRODA':
return $('#product_name').val('Product A');
case 'INVPRODB':
return $('#product_name').val('Product B');
case 'Add New':
$("#invoice_product_code_invoice_product_code").val('INVPRODA');
return $('#windowCreateInvoiceProductDialog').modal("show");
default:
return $('#product_name').val('Something');
}
});
});