how to conditional display a control in asp wizard based on the radiobutton click in a particular st

Posted by Pramod on Stack Overflow See other posts from Stack Overflow or by Pramod
Published on 2010-06-12T07:05:59Z Indexed on 2010/06/12 7:12 UTC
Read the original article Hit count: 284

Filed under:
|
|

Hi,

I've been stuck with this problem where there are 3 steps in an asp wizard control. The first step has a radiobutton (yes and no) and based on the radio button input chosen by the user, i would need to hide or show a label in the second wizardstep.

Example:

Step 1: Choose 1 among the two options: Yes No (radStep1)

Step 2: if the radiobutton option in the previous step was yes.. then display a label(lblStep2) in this step.. Else hide the label.

I've been handling this through the jquery as i want the functionality in the aspx page itself...

The jquery code goes like this...

$("#<%=radStep1.ClientID %> input").click(function() {
if($("#<%= radStep1.ClientID %> input").index(this) == 0)
{
     $("#<%=lblStep2.ClientID %>").show();
}
else if($("#<%= radStep1.ClientID %> input").index(this) == 1)
{
    $("#<%=lblStep2.ClientID %>").hide();
}

However, in both the cases, the label is getting displayed.. Could you please help me out if there is anything that i'm missing?

I'm guessing that the label is getting hidden at first and then getting shown again once i click on the next button...

Thanks a ton in advance....

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about radiobutton