-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extension to customize hx-confirm? #434
Comments
I think a solution to this problem could be generalized to solve #401 (trigger of JS-based form validation before
basically a generalized way to determine if |
What if you re-define the confirm function? window.confirm = function(msg, callback) {
// ...
} |
There are actually some stackoverflow discussions on overriding But I suppose overriding a system function should be avoided if at all possible. |
I had an old example done in intercooler that used events for something like this: https://intercoolerjs.org/examples/bootstrap_confirm.html It can probably be ported to htmx pretty easily. Might be worth looking at. |
Thanks for the information, which actually help answer one of my old questions, namely how to trigger |
hx-confirm
is nice butwindow.confirm
is a bit primitive. I am trying to write an extension forbootlox.confirm
but not sure how to do it (e.g. which event to intercept and how to returnconfirmed
status). Any suggestion on how I should proceed?Something like
htmx.config.confirmFunction
would also be possible though.The text was updated successfully, but these errors were encountered: