Answered by:
How to disable jqte editor control in asp.net

Question
-
User2140887522 posted
Dear all,
I am using jqte editor control in my asp.net page.
<textarea id="txtPackageChargesBillInfo" name="txtPackageChargesBillInfo" class="jqte-test" style=" width:300px; height:100px;" runat="server" rows="0" cols="0"></textarea>
I need to know how i disable this editor that user cant write anything in it. I have used below code but its not working
$("#txtPackageChargesBillInfo").find(".jqte_editor").attr("contenteditable", "false");
may be i m missing something. please guide me.
Thanks in adv.
Wednesday, September 27, 2017 6:23 AM
Answers
-
User2103319870 posted
You can disable the Editor control using below jquery code
//Disabling the editor $(".jqte_editor").prop('contenteditable','false');
Complete Code
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-te/1.4.0/jquery-te.css" /> <script src="https://code.jquery.com/jquery-3.1.0.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-te/1.4.0/jquery-te.min.js" integrity="sha256-dqzaSjHvxYNzVwP9AZ+mu8N/G2F5wI5lcj97yy2kUGs=" crossorigin="anonymous"></script> <script> $(document).ready(function() { $("#txtPackageChargesBillInfo").jqte(); //Disabling the editor $(".jqte_editor").prop('contenteditable','false'); }); </script> </head> <body> <textarea id="txtPackageChargesBillInfo" name="txtPackageChargesBillInfo" class="jqte-test" style=" width:300px; height:100px;" runat="server" rows="0" cols="0"></textarea> </body> </html>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 27, 2017 2:05 PM -
User-1838255255 posted
Hi Muhammad,
Through your needs, I make a sample to disabled editor in my side, please check:
Sample Code:
<head runat="server"> <title></title> <link href="jquery-te-1.4.0.css" rel="stylesheet" /> <script src="Scripts/jquery-2.1.0.js"></script> <script src="jquery-te-1.4.0.min.js"></script> <script> $(function () { $(".jqte-test").jqte(); $(".jqte_editor").attr("contenteditable", "false"); }); </script> </head> <body> <form id="form1" runat="server"> <div> <textarea id="txtPackageChargesBillInfo" name="txtPackageChargesBillInfo" class="jqte-test" style="width: 300px; height: 100px;" runat="server" rows="0" cols="0"></textarea> </div> </form> </body>
Best Regards,
Eric Du
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 28, 2017 2:57 AM
All replies
-
User2103319870 posted
You can disable the Editor control using below jquery code
//Disabling the editor $(".jqte_editor").prop('contenteditable','false');
Complete Code
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jquery-te/1.4.0/jquery-te.css" /> <script src="https://code.jquery.com/jquery-3.1.0.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-te/1.4.0/jquery-te.min.js" integrity="sha256-dqzaSjHvxYNzVwP9AZ+mu8N/G2F5wI5lcj97yy2kUGs=" crossorigin="anonymous"></script> <script> $(document).ready(function() { $("#txtPackageChargesBillInfo").jqte(); //Disabling the editor $(".jqte_editor").prop('contenteditable','false'); }); </script> </head> <body> <textarea id="txtPackageChargesBillInfo" name="txtPackageChargesBillInfo" class="jqte-test" style=" width:300px; height:100px;" runat="server" rows="0" cols="0"></textarea> </body> </html>
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Wednesday, September 27, 2017 2:05 PM -
User-1838255255 posted
Hi Muhammad,
Through your needs, I make a sample to disabled editor in my side, please check:
Sample Code:
<head runat="server"> <title></title> <link href="jquery-te-1.4.0.css" rel="stylesheet" /> <script src="Scripts/jquery-2.1.0.js"></script> <script src="jquery-te-1.4.0.min.js"></script> <script> $(function () { $(".jqte-test").jqte(); $(".jqte_editor").attr("contenteditable", "false"); }); </script> </head> <body> <form id="form1" runat="server"> <div> <textarea id="txtPackageChargesBillInfo" name="txtPackageChargesBillInfo" class="jqte-test" style="width: 300px; height: 100px;" runat="server" rows="0" cols="0"></textarea> </div> </form> </body>
Best Regards,
Eric Du
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Thursday, September 28, 2017 2:57 AM