ラジオボタンをクリックしたときに確認ダイアログを表示する方法は誰でも知っています。http://projectshadowlight.org/jquery-easy-confirm-dialog/
からコードをダウンロードしました。それを微調整するのに少し混乱しています。
以下のコードは、ラジオボタンがクリックされる前に確認ダイアログをトリガーします!デフォルトのウィンドウダイアログを使用すると、正常に機能します(ラジオをクリックしてからポップアップします)?任意の解決策をお願いします!
**HTML:**
<input class="8" id="block_t" name="t_products" onclick="goingnow(this)" type="radio" value="Block x10 (3mins)" rel="3">Block x10 (3mins)
<input class="9" id="block_t" name="t_products" onclick="goingnow(this)" type="radio" value="Block x10 (3mins)" rel="4">Block x10 (6mins)
**javaScript function:**
function goingnow(_this){
if ($("#going_now").attr("value") == 1) {
$("#going_now").attr("value", 0);
} else {
if ($(_this).is(":checked") == true) {
var conf = $(_this).is(":checked").easyconfirm({locale: { title: 'Select Yes or No', button: ['No','Yes']}});
if (conf){
$("#going_now").attr("value",1);
$("#block_mins").attr("value", $(_this).attr("rel"));
} else {
$("#block_mins").attr("value", $(_this).attr("rel"));
}
}
}
}