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
- 회계
- 재고 관리
- PoS
- Project
- MRP
신고된 질문입니다
1
회신
4885
화면
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
관련 게시물 | 답글 | 화면 | 활동 | |
---|---|---|---|---|
|
2
5월 25
|
9653 | ||
|
3
3월 24
|
5260 | ||
|
1
1월 21
|
3306 | ||
|
1
6월 18
|
3316 | ||
|
0
1월 25
|
1021 |