이것은 내가 지금까지 시도한 것이다. 어떻게 배열 만 변수 값을 업데이트 못하고Array에서 특정 변수 값을 업데이트하는 방법은 무엇입니까?
내가 +1하여 배열에서 중복 항목을 발견 할 때마다 수량 변수 값을 늘려야 할allVals = [];
var qty;
jQuery(".big:checked").each(function() {
qty = parseInt(jQuery(this).parents().nextAll().children().find('input[name="quantity"]').val());
if (jQuery.inArray(jQuery(this).val(), allVals) == -1) {
allVals.push(jQuery(this).val() + ',' + qty + ',' + 'custcol_name_of_attendees|' + nameatt + '||custcol_email_of_attendees|' + emattendee + '||custcol_event_name|' + eventname + '| |custcol_event_location|' + eventlocation); //not present in array
} else {
qty = parseInt(jQuery(this).parents().nextAll().children().find('input[name="quantity"]').val()) + 1;
// update only qty value in allVals array
}
});
:
그런 다음, 당신은 단지
=
운영자에 의해 값을 갱신 "] '). val()'? –그것은 나에게 선택된 체크 박스 수량 필드 값을 줄 것이다 .... 그것은 1,2,3 등 – Uidev123