Jquery Checkbox Kontrol
Checkbox True olanları hidden box aktarılması
function selectedChecked() {
var resultChecked = "";
$('input').filter(function () {
if (this.type == "checkbox") {
if (this.checked == true) {resultChecked = resultChecked + this.id + "Æ"; }
}
});
$("#RegionsHidengBox").val(resultChecked);
}
---------------------
Checkbox id'lerini tutmaktadır.
$(function () {
var resultChecked = "";
$("input[type=checkbox]").on("click",
function () {
if ($(this).is(':checked')) {
resultChecked = resultChecked + this.id + "Æ";
} else { resultChecked = resultChecked.replace(resultChecked.substr(resultChecked.indexOf(this.id), this.id.length + 1), ""); alert(resultChecked); }
});
$("#Submit").click(function () {
$("#RegionsHidengBox").val(resultChecked);
//alert($("#RegionsHidengBox").val());
});
});
-----------------
$(function () {
var resultChecked = "";
$("#RagionsForm_Layout_Row_0 input[type=checkbox]").on("click",
function () {
if ($(this).is(':checked')) {
resultChecked = resultChecked + this.id + "Æ";
} else { resultChecked = resultChecked.replace(resultChecked.substr(resultChecked.indexOf(this.id), this.id.length + 1), "");}
});
$("#Submit").click(function () {
$("#RegionsHidengBox").val(resultChecked);
});
$("#RegionsFormBtn1").click(function () {
$("#RegionsHidengBox").val(resultChecked);
});
var ValueHidden = $("#RegionsHidengBox").val();
if (ValueHidden != "") {
ValueHidden = ValueHidden.split(",");
for (var i=0; i<ValueHidden.length; i++){
$("#"+ValueHidden[i]).prop('checked', true);
}
}
});
function selectedChecked() {
var resultChecked = "";
$('input').filter(function () {
if (this.type == "checkbox") {
if (this.checked == true) {resultChecked = resultChecked + this.id + "Æ"; }
}
});
$("#RegionsHidengBox").val(resultChecked);
}
---------------------
Checkbox id'lerini tutmaktadır.
$(function () {
var resultChecked = "";
$("input[type=checkbox]").on("click",
function () {
if ($(this).is(':checked')) {
resultChecked = resultChecked + this.id + "Æ";
} else { resultChecked = resultChecked.replace(resultChecked.substr(resultChecked.indexOf(this.id), this.id.length + 1), ""); alert(resultChecked); }
});
$("#Submit").click(function () {
$("#RegionsHidengBox").val(resultChecked);
//alert($("#RegionsHidengBox").val());
});
});
-----------------
$(function () {
var resultChecked = "";
$("#RagionsForm_Layout_Row_0 input[type=checkbox]").on("click",
function () {
if ($(this).is(':checked')) {
resultChecked = resultChecked + this.id + "Æ";
} else { resultChecked = resultChecked.replace(resultChecked.substr(resultChecked.indexOf(this.id), this.id.length + 1), "");}
});
$("#Submit").click(function () {
$("#RegionsHidengBox").val(resultChecked);
});
$("#RegionsFormBtn1").click(function () {
$("#RegionsHidengBox").val(resultChecked);
});
var ValueHidden = $("#RegionsHidengBox").val();
if (ValueHidden != "") {
ValueHidden = ValueHidden.split(",");
for (var i=0; i<ValueHidden.length; i++){
$("#"+ValueHidden[i]).prop('checked', true);
}
}
});
Yorumlar
Yorum Gönder