Hi, I have client like this
They have the same class but not id, their id is automatic genrate like
chdbirthdate1
, chdbirthdate2
, chdbirthdate3
. . .I have made an on-click function with their class but still not know how to get value for each
input
tag. Please help me! @nolimits4web
$$('.childbirthday').on('click',
function () {
var birthcalendar = app.calendar.create({
inputEl: $$(this).children('input[type="text"][readonly="readonly"]'),
dateFormat: 'dd M yyyy',
header: true,
footer: true,
openIn: 'customModal',
dayNamesShort: ['CN', 'th 2', 'th 3', 'th 4', 'th 5', 'th 6', 'th7'],
monthNames: [
'Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10',
'Tháng 11', 'Tháng 12'
],
monthNamesShort: [
'Tháng 1', 'Tháng 2', 'Tháng 3', 'Tháng 4', 'Tháng 5', 'Tháng 6', 'Tháng 7', 'Tháng 8', 'Tháng 9', 'Tháng 10',
'Tháng 11', 'Tháng 12'
],
renderHeader: function () {
return '<div class="nav-c">' +
'<table>' +
'<tr>' +
'<td class="left">' +
'<a href="#" class="nav-c__button"></a>' +
'</td>' +
'<td class="center">' +
'<div class="nav-c__Text">' +
'Chọn ngày sinh' +
'</div>' +
'</td>' +
'<td class="right">' +
'<a href="#" class="link nav-c__button nav-c__button--close calendar-close sheet-close popover-close"></a>' +
'</td>' +
'</tr>' +
'</table>' +
'</div>';
},
renderFooter: function () {
return '<div class="link-buttton-calendar"><a href="#" class="link button-c calendar-close sheet-close popover-close">Hoàn thành</a></div';
},
on: {
dayClick: function (calendar, dayEl, year, month, day) {
var birthdate = '' + year + '-' + month + '-' + day + '';
alert(birthdate);
($$(this).children('input[type="text"][readonly="readonly"]')).text(splitStr(birthdate));
($$(this).children('input[type="text"][readonly="readonly"]')).val(splitStr(birthdate));
}
}
});
birthcalendar.open();
});