Hiding fields and removing them from a check function

Vzupo

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 === "";
});
Rory McCrossan

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] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Hiding ListViewItem instead of removing it?

분류에서Dev

VBSCRIPT REPLACE not removing spaces from Decrypted fields

분류에서Dev

Removing muliple items from listview using Check box in Android

분류에서Dev

C++ removing an std::function from a std::vector<std::function<...>>

분류에서Dev

Hiding a particular image from RSS

분류에서Dev

Hiding WPF controls from toolbox

분류에서Dev

Removing Text From A TextBox

분류에서Dev

Removing spacing from string

분류에서Dev

Data Grouping hiding data from Chart?

분류에서Dev

Hiding files of a certain extension (.pyc) from Nautilus

분류에서Dev

jquery auto calculate fields and adding them togheter

분류에서Dev

C++ check from where specified function/method was called

분류에서Dev

Removing Specific Strings from File

분류에서Dev

Removing a subclass object from parent?

분류에서Dev

Android - Removing an ImageView from a RelativeLayout

분류에서Dev

Removing item from list - casting

분류에서Dev

Removing shadow from button WPF

분류에서Dev

Prevent a user from removing file

분류에서Dev

Removing repeated objects from ArrayList

분류에서Dev

My Image is not removing from folder

분류에서Dev

Removing "Loading..." from PFQueryTableViewController

분류에서Dev

Removing deepin from update command

분류에서Dev

Removing same files from folders

분류에서Dev

Type Error when removing a child and removing it from an array

분류에서Dev

Ruby on Rails saving two fields and combining them as a third

분류에서Dev

Type check ... rest fields of an object with Typescript

분류에서Dev

Function Based Check Constraint

분류에서Dev

js - check if a function is completed

분류에서Dev

Function Based Check Constraint