https://htmx.org logo
Hello, I need some help from because I have an is...
# htmx-general
p
Hello, I need some help from because I have an issue with HTMX and I can't find a way to explain why it happens : My application is a Razor Pages app, if I click on a button with a bad payload my application respond with HTTP400 and I use a trigger to open a notification (this trigger is calling another endpoint of my app to generate the html for the popup) The problem : if I navigate to the page with my button and I click it, the trigger will call the popup twice. If I refresh the page and click the button the trigger will call the popup once. Here is the trigger code
Copy code
javascript
htmx.on('notify', function(e) {
    console.log(e.detail);
    console.log(e);
    htmx.ajax('POST', '/flashmessage', {target:'#notification', swap:'innerHTML', values: e.detail})
})
Do you have any idea why is this happening or where should I start looking, this is driving me crazy.