2014-09-16 2 views
0

this question을 확장 중입니다.jquery에 여러 필터 추가 찾기

form.find('input,a,select').filter(':visible') 

는 어떻게 추가 할 수있는 필터를 사용하지 입력 필드를 제거하고 0보다 큰의 tabindex 데 : 나는이 다음과 같은 코드가? 지금까지 나는 .not(':disabled') and .not('input[tabindex>"0"]')과 결합을 시도했지만 효과가 없습니다.

+2

'형태이다. –

+1

을 처리해야하므로'form.find ('input, a, select') 필터를 사용하십시오 filter (': visible : visible '). not (': disabled '). 필터 (function() { return th is.tabIndex> 0 })' –

답변

2

귀하의 not() 필터가 작동합니다 ...하지만 tabIndex를 위해 당신은

form.find('input,a,select').filter(':visible').filter(function() { 
    return this.tabIndex > 0 
}).not(':disabled') 

같은 동일한 기능을 수행하는 또 다른 방법은 사용자 정의 필터를 작성해야합니다

form.find('input,a,select').filter(function() { 
    return this.tabIndex > 0 && $(this).is(':visible:not(:disabled)') 
})