I am trying to update the text area displayed in the Ajax modal popup. I am updating the Text area with sharepoint list multiline text field. My spservices is wriiting the data correctly. But when i try to appened the Text area it is unable to show the same.

I am trying to append the data on button click.

here is my code

<script type="text/javascript" language="javascript">

    function GetListData() 
        var method = "GetListItems";
        var list = "WOGDates";
        var fieldsToRead = "<ViewFields>" +
                                "<FieldRef Name='Title' />" +
                                "<FieldRef Name='WOGLicense' />" +

        var query = "<Query>" +
                        "<Where>" +
                            "<Neq>" +
                                "<FieldRef Name='ID'/><Value Type='Number'>0</Value>" +
                            "</Neq>" +
                        "</Where>" +
                        "<OrderBy>" +
                            "<FieldRef Name='Title'/>" +
                        "</OrderBy>" +
            operation: method,
            async: false,
            listName: list,
            CAMLViewFields: fieldsToRead,
            CAMLQuery: query,
            //this basically means "do the following code when the call is complete"
            completefunc: function (xData, Status) {
                $(xData.responseXML).SPFilterNode("z:row").each(function () {
                    var name = ($(this).attr("ows_Title"));
                    var WOGLicensetext = $($(this).attr("ows_WOGLicense")).text();
                    AppenedData(name, WOGLicensetext);
        function AppenedData(name, WOGLicensetext) 





    <asp:Label ID="lbl_noact" runat="server" Visible="False" Width="282px" CssClass="style4"></asp:Label>
    <asp:GridView runat="server" ID="gvdetails" DataKeyNames="EventID" AutoGenerateColumns="false" Width="502px">
        <RowStyle BackColor="#EFF3FB" />
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
            <asp:BoundField DataField="EventDate" HeaderText="Start Time" ItemStyle-CssClass="col" />
            <asp:BoundField DataField="EndDate" HeaderText="End Time" ItemStyle-CssClass="col" />
            <asp:TemplateField HeaderText=" ">
                    <asp:HiddenField ID="EventID_HiddenField" runat="server" Value='<%# Eval("EventID")%>' />
                    <asp:Button ID="ButtonAdd" runat="server" Text="Sign Up" Width="80" Height="25" OnClick="SignUp_Click" OnClientClick="GetListData()"/>
    <asp:Button ID="btnShowPopup" runat="server" Style="display: none" />
    <ajaxToolkit:ModalPopupExtender ID="ModalPopupExtender2" runat="server" TargetControlID="btnShowPopup" PopupControlID="pnlpopup" BackgroundCssClass="modalBackground" Drag="true" DropShadow="true">

 <asp:Panel ID="pnlpopup" runat="server"  BackColor="LightGray" Height="500px" Width="800px" Style="display: none">
        <table style="width: 100%; height: 100%;">         
                <td align="center" 
                    style="background-color: #79A2E2; width: 350px; height: 80%;">
                        <b style="color: #000000; font-size:11pt; font-style: normal; font-weight: bold; font-family: Arial, Helvetica, sans-serif;">
                            just a test
                            <br />                            
                            this date has to be finished
                            <br />
                           santosh </b>
                    <br />
                    <br />

                    <span><textarea  name="nTxtArGenHtml" id="idTxtArGenHtml" width='100%' cols="8" rows="8"></textarea></span>
                    <%--<asp:TextBox ID="TextBox1" runat="server" TextMode="MultiLine" Wrap="True" Width="80%" Height="300px">
                    <br />
                    <br />
                    <asp:HiddenField ID="PnlPopup_Hiddenfeild" runat="server" />
                    <asp:Button ID="Agree" runat="server" Text="I have read and agree to the above terms"
                        CommandName="SignUp" OnClick="btnAgree_Click" />&nbsp;&nbsp;&nbsp;
                    <asp:Button ID="Cancel" runat="server" Text="Cancel I Do Not Agree" />


2 Answers 2


You are passing two strings (name and WOGLicensetext) to your AppendData function, yet in the function you are trying to access a result object, which probably doesn't exist in that scope.

So you should change




You should use




depend on if you want to display it as html tags or plain text.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.