Set the value of Textbox in Gridview using Jquery
I HAVE A GRID VIEW grdtest. WANT TO UPDATE THE TEXTBOX IN THE GRID USING JQUERY FROM A MODAL POP UP THAT APPEARS ON THE ANCHOR CLICK. HAVE ADDED THE CODE BUT THE MODAL POPUP UPDATES ALL THE TEXTBOX IN THE GRID. WANTS TO UPDATE ONLY THE TEXTBOX IN ROW FROM WHICH THE ANCHOR LINK IS CLICKED. ANYONE PLEASE

THE GRID LOOKS LIKE THIS

    <div id="output">
    <asp:GridView ID="grdtest" CssClass="grid" Width="20%"
     AutoGenerateColumns="false"   runat="server"
     DataKeyNames="ID" OnRowCreated="grdtest_RowCreated" OnRowCommand="grdtest_RowCommand">
    <Columns>
    <asp:BoundField DataField="ID" Visible="false" />
    <asp:BoundField HeaderText="NAME"  DataField="NAME" ItemStyle-Width="5%"/>
    <asp:TemplateField HeaderText="MONTH" ItemStyle-Width="5%">
    <ItemTemplate>
    <asp:TextBox ID="txtsubject" runat="server" Wrap="true"></asp:TextBox>
    </ItemTemplate></asp:TemplateField>
    <asp:TemplateField ItemStyle-Width="2%">
    <ItemTemplate><a href="#" onclick="ShowDialog()">Month</a>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </div>

THE MODAL POP UP LOOKS LIKE THIS ONE BELOW

    <div id="dialog" class="web_dialog">
        <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
            <tr>
                <td class="web_dialog_title">Month Chooser</td>
                <td class="web_dialog_title align_right">
                    <a href="#" id="btnClose">Close</a>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 15px;">
                    <b>Choose the months from the list </b>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 15px;">
                    <div id="months">
                        <input id="month1" name="month" type="checkbox" value="Jan" />January
                        <input id="month2" name="month" type="checkbox" value="Feb" />February
                        <input id="month3" name="month" type="checkbox" value="Mar" />March
                        <input id="month4" name="month" type="checkbox" value="Apr" />April
                        <input id="month5" name="month" type="checkbox" value="May" />May
                    </div>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <input id="btnSubmit" type="button" value="Submit" />
                </td>
            </tr>
        </table>
    </div>

THE BUTTON CLICK EVENT IN JQUERY IS

    $('#btnSubmit').click(function(e)
            {
                var sub = [];
                $(':checkbox:checked').each(function(i){
                sub[i] = $(this).val();
                });
                $("#grdtest").find("input[type=text][id*=txtsubject]").val(sub);
                HideDialog();
                e.preventDefault();
    });
Set the value of Textbox in Gridview using Jquery
===

I HAVE A GRID VIEW grdtest. WANT TO UPDATE THE TEXTBOX IN THE GRID USING JQUERY FROM A MODAL POP UP THAT APPEARS ON THE ANCHOR CLICK. HAVE ADDED THE CODE BUT THE MODAL POPUP UPDATES ALL THE TEXTBOX IN THE GRID. WANTS TO UPDATE ONLY THE TEXTBOX IN ROW FROM WHICH THE ANCHOR LINK IS CLICKED. ANYONE PLEASE

THE GRID LOOKS LIKE THIS

    <div id="output">
    <asp:GridView ID="grdtest" CssClass="grid" Width="20%"
     AutoGenerateColumns="false"   runat="server"
     DataKeyNames="ID" OnRowCreated="grdtest_RowCreated" OnRowCommand="grdtest_RowCommand">
    <Columns>
    <asp:BoundField DataField="ID" Visible="false" />
    <asp:BoundField HeaderText="NAME"  DataField="NAME" ItemStyle-Width="5%"/>
    <asp:TemplateField HeaderText="MONTH" ItemStyle-Width="5%">
    <ItemTemplate>
    <asp:TextBox ID="txtsubject" runat="server" Wrap="true"></asp:TextBox>
    </ItemTemplate></asp:TemplateField>
    <asp:TemplateField ItemStyle-Width="2%">
    <ItemTemplate><a href="#" onclick="ShowDialog()">Month</a>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>
    </asp:GridView>
    </div>

THE MODAL POP UP LOOKS LIKE THIS ONE BELOW

    <div id="dialog" class="web_dialog">
        <table style="width: 100%; border: 0px;" cellpadding="3" cellspacing="0">
            <tr>
                <td class="web_dialog_title">Month Chooser</td>
                <td class="web_dialog_title align_right">
                    <a href="#" id="btnClose">Close</a>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 15px;">
                    <b>Choose the months from the list </b>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="padding-left: 15px;">
                    <div id="months">
                        <input id="month1" name="month" type="checkbox" value="Jan" />January
                        <input id="month2" name="month" type="checkbox" value="Feb" />February
                        <input id="month3" name="month" type="checkbox" value="Mar" />March
                        <input id="month4" name="month" type="checkbox" value="Apr" />April
                        <input id="month5" name="month" type="checkbox" value="May" />May
                    </div>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;">
                    <input id="btnSubmit" type="button" value="Submit" />
                </td>
            </tr>
        </table>
    </div>

THE BUTTON CLICK EVENT IN JQUERY IS

    $('#btnSubmit').click(function(e)
            {
                var sub = [];
                $(':checkbox:checked').each(function(i){
                sub[i] = $(this).val();
                });
                $("#grdtest").find("input[type=text][id*=txtsubject]").val(sub);
                HideDialog();
                e.preventDefault();
    });