I added custom button inside a website form but after clicking it always calls website/form controller and says 'Bad Request'. How I make it call only JS function that I added without going to controller?
Odoo is the world's easiest all-in-one management software.
 It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
            
                1
                
                    Trả lời
                
            
        
        
            
                5690
                
                    Lượt xem
                
            
        
    Hi,
In .xml
<button name="my_button" type="object" string="My Button" on_click="my_js_function"/>
js:-
function my_js_function() {
    // code for your JavaScript function goes here
  }
  // add event handler for button click event
  document.getElementById('my_button').addEventListener('click', function(event) {
    // call JavaScript function
    my_js_function();
    // prevent default action of button
    event.preventDefault();
  });
Regards
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng ký| Bài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
|---|---|---|---|---|
|  | 2 thg 5 25  | 10383 | ||
|  | 3 thg 3 24  | 6084 | ||
| 
            
                Website form field conditions
            
            
                    Đã xử lý
            
         |  | 1 thg 1 21  | 3998 | |
|  | 1 thg 6 18  | 3920 | ||
|  | 0 thg 1 25  | 1836 | 
