Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
1125 Näkymät

Hello Odoo Community,


I hope this message finds you well. I am currently working on customizing a page of the website in Odoo 17 using the HTML/CSS editor. My goal is to display content dynamically when a user clicks on a button. However, I am facing challenges in connecting the button to the associated JavaScript code.

I have tried injecting the JavaScript code into the head, adding it to a separate JS file, and including it within the 

Avatar
Hylkää

you can use "t-on-click", something similar to this
<button class="o_event_select_attendee btn btn-primary mb16" t-on-click="onClickSelectAttendee()">
<div class="mb16 mt16">Select Attendee</div>
</button>

Tekijä Paras vastaus

I attempted the solution you suggested using 't-on-click', the function (onClickSelectAttendee()) does not execute when the button is clicked 


Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
maalisk. 24
1117
0
marrask. 22
1574
0
heinäk. 15
5773
2
syysk. 21
52331
0
jouluk. 17
3323