piter11
چهارشنبه 14 تیر 1396, 22:39 عصر
من در view به این شکل از دیتا بیس فیلدامو به صورت چک باکس میخونم ولی مشکل اینه وقتی میخوام به صورت جاوااسکریپت بفرستمش هیچ مقداری نمیفرسته! ممنون میشم بگید مشکلم چیه؟
@foreach (var item in qcity)
{
<input type="checkbox" id="chk-f-blue-grey@(item.ID)" class="chk-col-blue-grey filled-in" value="@item.ID" />
<label for="chk-f-blue-grey@(item.ID)">@item.NameCity</label>
}
function submit() {
var selectedIDs = new Array();
$('input:chk-col-blue-grey filled-in').each(function () {
if ($(this).prop('checked')) {
selectedIDs.push($(this).val());
}
})
var model = $("#example1");
var title = $("#title").val();
var des = $("#description").val();
var vahed = $("#vahed").val();
var count = $("#counthadaf").val();
var date = $("#date").val();
$.ajax({
url: '/admin/submitshakhes',
datatype: 'html',
type: 'POST',
data: { title: title, description: des, vahed: vahed, counthadaf: count, date: date, ID: selectedIDs },
@foreach (var item in qcity)
{
<input type="checkbox" id="chk-f-blue-grey@(item.ID)" class="chk-col-blue-grey filled-in" value="@item.ID" />
<label for="chk-f-blue-grey@(item.ID)">@item.NameCity</label>
}
function submit() {
var selectedIDs = new Array();
$('input:chk-col-blue-grey filled-in').each(function () {
if ($(this).prop('checked')) {
selectedIDs.push($(this).val());
}
})
var model = $("#example1");
var title = $("#title").val();
var des = $("#description").val();
var vahed = $("#vahed").val();
var count = $("#counthadaf").val();
var date = $("#date").val();
$.ajax({
url: '/admin/submitshakhes',
datatype: 'html',
type: 'POST',
data: { title: title, description: des, vahed: vahed, counthadaf: count, date: date, ID: selectedIDs },