I have 2 files, 1 for the PHP(html) and 1 for the JS code. I want to confirm any change on my SELECT...
PHP:
<select id="transfer_option" onchange="transfer_select()">
foreach (get_users() as $user){
<option>$user['email']</option>
}
</select>
and on my JS file :
transfer_select() {
if(confirm('Are you sure ?')){
*ajax code, not important*
}
}
But when I change the option and cancel, the option change anyway...
Use another jquery library like a sweet alert for confirmation
https://sweetalert2.github.io/