I'm not able to add a data-state as I did with the remaining tag (value, type, name, etc) as shown in the following image:
$(".clicka").on("click", function () {
$('#calendartable .tdfull').each(function (k) {
if ($(this).data("id")) {
$('<input/>').attr({
type: 'hidden',
name: 'disponibilidade[' + k + ']',
value: $(this).data("id"),
state: $(this).data("pending"),
}).appendTo('form');
}
$('<input/>').attr({
type: 'hidden',
name: 'disponibilidade[' + k + '].titulo',
value: $(this).data("start") + ' - ' + $(this).data("end"),
state: $(this).data("pending"),
}).appendTo('form');
$('<input/>').attr({
type: 'hidden',
name: 'disponibilidade[' + k + '].inicio',
value: $(this).data("start"),
state: $(this).data("pending"),
}).appendTo('form');
$('<input/>').attr({
type: 'hidden',
name: 'disponibilidade[' + k + '].fim',
value: $(this).data("end"),
state: $(this).data("pending"),
}).appendTo('form');
});
It does not recognize the state, and I think it's doing something wrong. I wanted to put the status in pending. Is there an event that does it? I searched the deferred area but did not get the idea. Thank you.