I have this function which accepts obj (Jq object) as a parameter
However , in this function , I only need obj which is :not(:disabled) and :not([readonly]
currently I’ve managed to do it with :
function CheckRequiredSelection(obj)
{
obj.find(".requiredSelection:visible:not(:disabled):not([readonly])").andSelf().each(function ()
{
...
});
}
But I really want to get rid of find and addSelf trick.
Any help ?
The document can contain :
Edit #1
…
<select class="requiredSelection">
...
</select>
<select class="requiredSelection">
...
</select>
and before submit : I do something like :
CheckRequiredSelection($(".requiredSelection"))
Edit #2
I could have check inside the .each loop but then it wont be efficient since it’s after the selector. ( instead of getting 5 filtered elements from 100 , I will get 100 elements and THEN i’ll have to filter. That’s not nice).
I think you want
.filter().