Access a hiddenfield inside gridview using jquery and update it?
<p>Ive got a gridview in asp.net
One of the fields is a hiddenfield inside of the gridview:</p>

<pre><code> &lt;asp:TemplateField&gt;
                                 &lt;ItemTemplate&gt;
                                      &lt;input type="hidden" value="0" id="hdnIsChanged" runat="server" /&gt;
                                 &lt;/ItemTemplate&gt;
                            &lt;/asp:TemplateField&gt;
</code></pre>

<p>I have a radiobuttonlist inside the grid view as well, with a jquery click event which is working...
Here is that event:</p>

<pre><code>$("#MainContent_gvLineItems input[id*='rbAnswer']").click(function () {
                    var parentRow = $(this).parents('tr').eq(1) //used to get the row at index 1, parents('tr').length prints 3.  
                    //tr around the checkbox is index 2
                    //tr around row is index 1
                    //tr around header is index 0
                    //so we want to get a reference to index=1
                    var firstCell = parentRow.find('td:eq(0)'); //find the first cell
                    var p = $(this).parents("div[id='dMainAnswer']").find(".Answer:first"); //used to find the panel
                    var val = $(this).val();

                    switch (val) //check the value 
                    {
                        case 'No':
                            firstCell.css('background-color', 'red');
                            p.show();
                            break;
                        case 'Yes':
                            firstCell.css('background-color', 'green');
                            p.hide();
                            break;
                        case 'N/A':
                            firstCell.css('background-color', 'gray');
                            p.hide();
                            break;
                        default:
                            firstCell.css('background-color', 'transparent');
                            p.show();
                            break;
                    }
                });
</code></pre>

<p>This is all fine, but within this click event I want to access the hidden field <code>hdnIsChanged</code> how do I reference it?  I tried:</p>

<p><code>alert($('input[id$=hdnAnswered').val());</code></p>

<p>But it continues to say undefined...
I want to be able to access it in this click event and set a value to it using jquery.
Please remember it is inside a gridview so it appears for every row...</p>

<p>Any help is appreciated.</p>
