좋아요. 양식이있는 jQuery 대화 상자가 있는데 이걸 알아 내려고 노력하고 있습니다 ... 내가하려는 일을 말로 표현할 수 있는지 보도록하겠습니다.jquery : ul이 비어있는 경우
3 개의 텍스트 상자가 있습니다. #apInterest
, #apPayment
및 #apPrincipal
과 같은 순서로 입력하십시오. 내가 뭘하려고 오전의
기본 영어 조건 : 다른 99.99 트리거 오류에 비해 0보다 작거나 큰 #apInterest
.val
경우에서의 keyup에
.. 그것이 어떤 li
이있는 경우하지 .hide
경우, ul#mylist
을 확인
#apPayment
의 경우 .val
이 0보다 작은 경우 오류가 발생합니다. 그렇지 않으면 li
의 목록을 확인하십시오.
#apPrincipal
#apPayment
나는 또한 나는 모든이와 유사한 기능을 가지고
if ($("#mylist :not(:contains(li))")){
$('#popuperrors').hide();
}
을 시도했지만 내가 바로이 순간
$('#apInterest').live("keyup", function(e) {
var parent = $('.inter').parents("ul:first");
if ($('#apInterest').val() < 0 || $('#apInterest').val() > 99.99) {
$('.inter').remove();
$('#mylist').append('<li class="inter">Interest Rate cannot be below 0 or above 99.99</li>');
$('#popuperrors').show();
$(this).addClass('error');
} else {
$(this).removeClass('error');
$('.inter').remove();
alert(parent.children().text);
if (parent.children().length == 0){
$('#popuperrors').hide();
}
}
});
을 가지고있는
로 3 textbox하지만 아무도 노력하고있는 것 같아요 .. 이걸 완료하는 방법에 대한 아이디어.
가능한 중복 (http://stackoverflow.com/questions/1526873/jquery-if-div-id-has-children) –