Подскажите как дописать вырали ли чекбокс в форме,
<div class="input_block clearfix">
<input type="checkbox" name="PROPERTY[230][0]" value="Yes" />Заказать такси?
</div>
И часть js обработка
document.addEventListener("DOMContentLoaded",function(){
var $ = jQuery,
osForm = $('form[name="iblock_add"],form[name="basket_form"]');
fields = {
fullname:{v:'[name="PROPERTY[NAME][0]"]',r:0},
email:{v:'[name="PROPERTY[87][0]"]',r:0},
phone:{v:'[name="PROPERTY[86][0]"]',r:1},
date:{v:'[name="PROPERTY[89][0]"]',r:0},
message:{v:'[name="PROPERTY[PREVIEW_TEXT][0]"]',r:0},
address:{v:'.select2-container.styled.mv-select .select2-chosen',r:0,html:1},
cart_text:{v:'[name="PROPERTY[92][0]"]',r:0}
}, _mask = '+7(999)999-99-99',
_phone = $(fields.phone.v);
_phone.mask && _phone.mask(_mask) || quickScript(/js/jquery.maskedinput.js',function(){
console.log('_mask',_mask);
_phone.mask && _phone.mask(_mask);
},10);
osForm.each(function(){
var oForm = $(this);
var f;
for(var k in fields){
f = fields[k];
if(f.r)oForm.find(f.v).attr('required','required');
}
var onsubmit = function(e){
var amoLead = window.amo_lead;
if(typeof(amoLead) !== "function")return;
var data = {},field;
for(var k in fields){
field = fields[k];
data[k] = oForm.find(field.v)[field.html ? 'html' : 'val']();
}
if(!data.phone || data.phone == '')return false;
if(!data.address || data.address == '')return false;
data.dealname = 'Запись на примерку на ' + window.location.hostname;
data.message = "Такси" + " \n" +"Адрес: " + data.address + " \n" + "Дата " + data.date + " \n" + data.message ;
amoLead({
data:data,
callback:function(){
console.log('Запись на примерку');
setTimeout(function(){
oForm.unbind('submit',onsubmit);
oForm.submit();
},500);
}
});
return false;
};
oForm.bind('submit',onsubmit);
});
});