Subversion Repositories SmartDukaan

Rev

Rev 24043 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24043 Rev 24044
Line 32... Line 32...
32
        updateTotalAmount();
32
        updateTotalAmount();
33
    });
33
    });
34
 
34
 
35
    $('input[name$=item_id]').live('change', function() {
35
    $('input[name$=item_id]').live('change', function() {
36
    	var count=0;
36
    	var count=0;
-
 
37
    	var that = this;
37
    	$(this).closest('table').find('tr').each(function(el){
38
    	$(this).closest('table').find('tr').each(function(el){
38
    		if($(el).find('input[name=item_id]').val()==$(this).val()) {
39
    		if($(that).find('input[name=item_id]').val()==$(this).val()) {
39
    			count += 1;
40
    			count += 1;
40
    		}
41
    		}
41
    	});
42
    	});
42
    	if(count==2) {
43
    	if(count==2) {
43
    		alert("item should not be repeated twice");
44
    		alert("item should not be repeated twice");