at first glance, you may be expecting the :hidden selector to work
differently than it actually does:

http://docs.jquery.com/Selectors/hidden

the original implementation, before 1.3.2, checked for either
display:none or visibility:hidden, whereas the new implementation
selects elements "...if it or its parents consumes no space in
document. CSS visibility isn't taken into account."

so, my first question would be, which version of jQuery are you using?
anything before 1.3.2 won't even return hidden inputs with the
":hidden" selector.

can you post a test page?

On Jan 7, 12:48 pm, CreativeMind <aftab.pu...@gmail.com> wrote:
> Hi,
> I have a dropdown which diplays a companyname with 4 hidden inputs.
> these hidden input values are set in text boxes on selected index
> change of dropdown.
> like this
>   var sourcedropdown = $(e.target).parent().parent().children(":nth-
> child(7)").children().eq(0);
>    $(sourcedropdown).append($('<option></option>').val(val).html
> (sourcename).addClass('selectedval'+val));
>    var priceval=text[1];
>    $.each(priceval,function(leftval,rightval){
>
>    $(sourcedropdown).append($('<input type="hidden" id="hid'+leftval
> +' />').val(rightval));
>
>                             });
>
> but when i change the selected value in dropdown, I expect 4 as the
> length of inputs, firefox shows 4 in alert but IE shows zero.
>
> var sourcedd=$(e.target).parent().parent().children(":nth-child
> (7)").children().eq(0);
>  $(sourcedd).change(function(){
>
>                     var hiddenchildrens=$(this).children
> ("input:hidden");
>                    alert(hiddenchildrens.length);});
> }
>
> should i append the hidden inputs in some other way ?
>
> thanx,

Reply via email to