Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
3643 Lượt xem

I want to use javascript eval function on float and integer input fields. For example in sale order, I want to calculate any product quantity like "2*6" I used my own jquery but id doesn't work, it seems odoo ignores it. Is there a way to do it? Thanks.

$(document).ready(function(){
  $('input[name=product_uom_qty]').change(function(e){                
    $(this).val(eval($(this).val()));
  })
});
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Please change event to onclick on add more. Because input is disabled.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 25
401
1
thg 7 25
5279
0
thg 7 25
823
0
thg 6 25
840
1
thg 6 25
1008