문제

I am having a webControl with 3 TextBoxes and I am using this webControl in same page but twice with 2 instances.

I want to hide one text box from one control and other text box from the other control .

<uc1:VoyageSelector runat="server" ID="VoyageSelector1"  Instance="1" />

<uc1:VoyageSelector runat="server" ID="VoyageSelector2"  Instance="2" />

This control is having text box classes as:

$(".vss-week-picker").val(); 
$('.vs-voyage-picker').val(); 
$('.vs-vessel-display').val(); 

When I disable:

$(".vss-week-picker").hide();

Both Controls Week TextBox is getting hidden. How can I solve this problem of hiding one instance class?

도움이 되었습니까?

해결책

Get the id of the element that the control produces, and use it to select your targets.

For example, if it produces a parent element with id 'VoyageSelector1', then you hide its textboxes like this :

$('.vss-week-picker','#ContentPlaceHolder1_VoyageSelector2_tblVoyageSelector').‌​hide();

다른 팁

i did this in past, don't remember exactly, may this works

$("[id ^= VoyageSelector1] .vss-week-picker").hide();
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top