Subversion Repositories SmartDukaan

Rev

Rev 4207 | Rev 22452 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4207 mandeep.dh 1
$(function() {
2
    $('input#add-item').live('click', function() {
3
        addNewRowForItem();
4
    });
5
 
6
    $('a#remove-item').live('click', function() {
7
        $(this).closest('tr').remove();
8
        updateTotalAmount();
9
    });
10
 
11
    $('#bulk-order').live('submit', function() {
12
        submitBulkOrderForm();
13
        return false;
14
    });
5527 anupam.sin 15
 
16
    $('#orderType').live('change', function() {
17
    	hideShowTin();
18
    	return false;
19
    });
4207 mandeep.dh 20
 
21
    $('input[name$=unit_price]').live('change', function() {
22
        var quantity = $(this).closest('tr').find('input[name$=quantity]');
23
        var price    = $(this).val();
24
        $(this).closest('tr').find('#item-amount').html(quantity * price);
25
        updateTotalAmount();
26
    });
27
 
28
    $('input[name$=quantity]').live('change', function() {
29
        var price = $(this).closest('tr').find('input[name$=unit_price]');
30
        var quantity    = $(this).val();
31
        $(this).closest('tr').find('#item-amount').html(quantity * price);
32
        updateTotalAmount();
33
    });
34
 
35
    $('input[name$=item_id]').live('change', function() {
36
        updateModelName($(this).closest('tr'), $(this).val());
37
    });
38
});