Hey All

On my page I have a table with a list a questions whose answers are
just yes or no. What I need to do is when the user clicks the radio
button "yes" a table element will show with some additional questions.

My problem is, I have 26 different yes - no questions all of which
will have different "id's" for each radio button and table element. Is
there a way to make my jQuery code dynamic so that I do not have to
repeat it over and over again with each of the different id's?

Here is the jQuery I have now, it works for the first question, but
how do I get this same set of code to work for all the question with
their different id's?

In the code : 1a_y is the id for the yes radio button
                    1a_n is the id for the no radio button

<script type="text/javascript">
$(document).ready(function(){
                $('#questions').hide();
                $('#questionLink').hide();
        $('#1a_y').click(function(){
                $('#questions').show();
                $('#questionLink').show();
                $('#1a_y').checked(true);
                return false;
                });
        $('#1a_n').click(function(){
                $('#questions').hide();
                $('#questionLink').hide();
                $('#1a_n').checked(true);
                return false;
                });
        $('#toggle1a').click(function(){
                $('#questions').toggle();
                return false;
                });
});
</script>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to