May-12-2020, 09:51 AM
Hello,
Im new to this forum, and already asking my first question ....
I googled a lot, but didnt found a clear answer for that.
Is it (somehow) possbile to add a "onclick" event to a checkbox / slider in flask ?
Just like in javascript ?
The goal should be that i check/uncheck a checkbox on the website, and my databaseUpdate function gets called, without pressing a confirm button, or a refresh of the site.
( in my opinion a confirmation button is intolerable for a user. It simply sucks to " confirm " a slider change / checkbox state change, to say it in rough words ... )
Well, back to the problem.
How could I solve that ?
Does it make sense, to set a href (/ does a onclick work ? )attribute to my checkbox, which redirects to a route, where i just call the update db function ?
I dont really know ...
Would appreciate any kind of help !
Thanks
Im new to this forum, and already asking my first question ....
I googled a lot, but didnt found a clear answer for that.
Is it (somehow) possbile to add a "onclick" event to a checkbox / slider in flask ?
Just like in javascript ?
The goal should be that i check/uncheck a checkbox on the website, and my databaseUpdate function gets called, without pressing a confirm button, or a refresh of the site.
( in my opinion a confirmation button is intolerable for a user. It simply sucks to " confirm " a slider change / checkbox state change, to say it in rough words ... )
Well, back to the problem.
How could I solve that ?
Does it make sense, to set a href (/ does a onclick work ? )attribute to my checkbox, which redirects to a route, where i just call the update db function ?
I dont really know ...
Would appreciate any kind of help !
Thanks