G,

I tried a quick demo of what you were trying to accomplish and I think I
have something that might work. I'm still pretty new around here, but I hope
this helps.

 $(document).ready(function(){
        var cnt = $('#errList li:visible').size();
        alert(cnt);
 });

If someone knows a better way, I'd love to learn.

-Adam


On Mon, Jun 2, 2008 at 2:50 PM, GiJeet <[EMAIL PROTECTED]> wrote:

>
> Hello, I just starting out with JQuery and I'm struggling with a
> problem.  I have an unordered list, id = "errList" with several list
> items.  Each list item has it's own id, e.g. id="one", id="two", etc.
> I'm using a CSS and in the CSS I use the id of each <li> to initially
> set the visibility of each to hidden (eg: visibility: hidden;).  Upon
> validating certain fields of the form, if validation fails I switch
> the visibility of a specific li to visibility: visible.  All works ok,
> except I have a header message such as "Please fix the following
> errors" and I only want to display this message if any of the list
> items have their visibility style attribute set to visible. So I want
> to get the count of list items where their visibility style attribute
> is set to visible but can't seem to extract that set.
>
> Some failed tries:
> var cnt = $('ul#errList
> li.style[visibility]').not('[visibility==hidden]');
> var cnt = $("#errList li").css("visibility" == "visible" ).size();
>
> any help would be appreciated.
>
> G
>

Reply via email to