Advertisement

08.10.2008 at 02:57PM PDT, ID: 23636520
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.8

Making a table row visible/invisible using javascript

Asked by Ashwin_shastry in JavaScript, Programming for ASP.NET, Microsoft Visual C#.Net

Tags: ,

Hello,

Iam a novice in Javascript and struggling to achieve the following.

I have a repeater control inside which I have a table structure as follows

<asp:Repeater ID="rptQuestions" runat="server"  onitemdatabound="rptQuestions_ItemDataBound">
         <ItemTemplate>
            <table>
            <tr>
               <td>
                   <table>
                        <tr>
                            <td><asp:Label ID="PrimaryQuestion" runat="server"></asp:Label></td>
                        </tr>                
                        <tr>
                            <td>
                                <asp:PlaceHolder runat="server" ID="PrimaryAnswerPholder" ></asp:PlaceHolder>
                            </td>
                        </tr>
                   </table>  
               </td>              
            </tr>
            <tr id="DependentQuestionAndAnswerRow" runat="server" visible="false">
                <td>
                    <asp:PlaceHolder  runat="server" ID="DependentQuestionAndAnswerPholder" ></asp:PlaceHolder>                
                </td>
            </tr>
            </table>          
           
        </ItemTemplate>
       </asp:Repeater>    

As you can see ... I have i will be displaying a primary question and in the "PrimaryAnswerPholder" I will add a radio buttonlist in the place holder in code behind ..

Now when I add a radiobutton list control to the "PrimaryAnswerPholder" place holder, I will display two choices .. say suppose the two choices are "Yes" and "No".

Only when the user clicks on the "Yes" option in the radio button list should i display the row "DependentQuestionAndAnswerRow" which is till now invisible(on page load) using javascript.

Now the problem iam facing is ...

 On click of the "Yes" radio button, I pass the Client Id of the  "DependentQuestionAndAnswerRow" from code behind to a javascript function to make it visible , but   document.getElementById(DependentQuestionRowId) returns a null as the "DependentQuestionAndAnswerRow" is set to invisible in the very begining itself i.e on page load. and the javascript is not able to find the element.

Is there a way I could make this work.  I will be displaying a list of  Primary questions with radio button list as their answers, if the user selects only the "Yes option"  I will have to display the dependent question. Is it possible to accomplish this using javascript ???

Hoping for some help.

Thanks,
Ash










Start Free Trial
[+][-]08.10.2008 at 03:05PM PDT, ID: 22200861

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.10.2008 at 03:14PM PDT, ID: 22200877

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]08.10.2008 at 03:18PM PDT, ID: 22200889

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: JavaScript, Programming for ASP.NET, Microsoft Visual C#.Net
Tags: c#,.net,javascript, Ie
Sign Up Now!
Solution Provided By: WBuffet
Participating Experts: 2
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628