Click here to Skip to main content
15,885,757 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
   <div class="box-c>
        <textarea cols="80" id="editor1" name="editor1" rows="10"  runat="server" clientidmode="Static"
            style="width: 900px;">
</textarea>
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="editor1"
            SetFocusOnError="true" Display="None" ErrorMessage="Enter Template" ValidationGroup="abc"></asp:RequiredFieldValidator>
        <asp:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender"
            runat="server" TargetControlID="RequiredFieldValidator1">
        </asp:ValidatorCalloutExtender>
    </div>



I tried using this code but i am not getting value :

        var msg = document.getElementById('editor1').innerHTML;
        alert(msg);
Posted
Updated 25-Sep-14 0:08am
v4
Comments
MuhammadUSman1 25-Sep-14 7:26am    
i think you are not getting because of placeholder.

using following code.
JavaScript
$("textarea[id$='editor1']").text()
//it will get textarea.


helping link
http://api.jquery.com/attribute-ends-with-selector/[^]

if any issue then let me know.

-> M.U
 
Share this answer
 
v3
alert(CKEDITOR.instances.editor1.getData());

alert(CKEDITOR.instances.editor1.getData('editor1'));


You must have to give API reference of ckeditor.
 
Share this answer
 
v2
Use value property ( or val() function if you're using jQuery)

JavaScript
var msg = document.getElementById('editor1').value;
 
Share this answer
 
Comments
Sinisa Hajnal 26-Sep-14 3:38am    
Why was this downvoted? And how did CKEditor come into the picture?
CKEDITOR.instances['editor1'].getData();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900