나는 이것을 설정했다. 이제 수정이 필요합니다.
- 페이지가 처음로드 될 때 라디오 버튼 중 하나가 미리 선택됩니다. 모두 충족 또는 모두 충족 또는 모두 누락. 지금은 모든 Met 버튼이 선택되었습니다.
- 모든 라디오 버튼이 비활성화되어 있습니다. 확인란을 선택한 다음 행 ID를 선택하면 텍스트 영역에 해당 행의 라디오 버튼 값만 채워집니다 (부분적으로 작동).
- 확인란을 선택하지 않으면 값이 채워집니다. (작동하지 않음)
- 사용자가 다른 라디오 버튼을 선택한 경우 (확인란 선택 후) 값을 업데이트해야합니다 (작동)
- 또한 누락 라디오 버튼을 선택하면 텍스트 필드가 표시되고 입력 된 값을 업데이트해야합니다. (Throws Undefined)
나는 꽤 많은 일을했지만, 모든 것이 작동하지 않습니다.
전문가가 다시 도움을받을 수 있습니까? 이와
$("input:radio").hover(function() {
$(this).prev('.r-title').show();
}, function() {
if (!$(this).is(':checked')) {
$(this).siblings('.r-title, .m-notes').hide();
}
});
//Radio Buttons
$("input:radio").click(function() {
$(this).parent().parent().find('.r-title, .m-notes').hide();
var totalRd = $('table').find('input:radio:checked').length;
var clicked = [];
$("#totalRd .rd-count").html(totalRd); //Counts the radio buttons clicked
$(this).siblings('.r-title, .m-notes').show();
$('table').find("input[type=radio]:checked").each(function() {
var selectedId = $(this).parent().parent().attr('id');
var newVal = ($(this).next('.m-notes:visible').length) ? this.value + "~" + $(this).next('.m-notes:visible').val() : this.value;
clicked.push(selectedId + "~" + newVal);
}); //checked
$("#inputhere").val(clicked.join('|'));
});
//Input Field for Missing Radio Button
$('.m-notes').keyup(function() {
var $self = $(this);
var clicked = [];
$('table').find("input[type=radio]:checked").each(function() {
var selectedId = $(this).parent().parent().attr('id');
var newVal = this.value + "~" + $(this).next('.m-notes').val();
clicked.push(selectedId + "~" + newVal);
}); //checked
$("#inputhere").val(clicked.join('|'));
});
//CheckBox
var clicked=[];
$("input:checkbox").change(function(){
$(this).parent().parent().find("input[type=radio]").prop('disabled',!this.checked);
});
추가되었지만 작동하지 않습니다. – 19eggs
체크 박스 변경 기능에 추가했습니다. 저장 버튼 클릭을 원하십니까? –
내가 이해할 수 있을지 모르겠다. 그러나 체크 박스를 클릭했을 때 선택된 라디오 버튼의 행 ID와 값만 텍스트 영역에 채워 져야한다. 이 확인란을 선택하지 않으면 텍스트 영역에 없어야합니다. 희망이 도움이됩니다. – 19eggs