I have a few input textfields on a screen and some hide at certain time. I am trying to disable them when they are hide()
.
I have tried .prop
and .attr
to disable, but during the check it is still treating them like they are there. Any suggestions?
So on my button function I have this variable that checks all the boxes to see if nothing is in it
var emptyTextBoxes = $('input:text').filter(function () {
return this.value === "";
});
You can use is()
with the :hidden
selector for this:
var emptyTextBoxes = $('input:text').filter(function () {
return !$(this).is(':hidden') && this.value === "";
});
Or :not
:
var emptyTextBoxes = $('input:text:not(:hidden)').filter(function () {
return this.value === "";
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다