Asked by:
Editable property

Question
-
User364663285 posted
Hi,
In textarea below, is there a way to disable editable property of it?<textarea id="ta1" name="MyEA" runat="server" ></textarea> <script type="text/javascript"> CKEDITOR.replace('<%=ta1.ClientID.Replace("_","$") %>', { toolbar: 'Mybar' }); </script>
Thursday, September 24, 2020 2:30 AM
All replies
-
User1535942433 posted
Hi wmec,
Accroding to your description,could you tell us your ckEditor's version is 4 or 5?They are different.
Assumely,you use ckEditor4.I suggest you could use readonly.It's designed for user.
More details,you could referr to below codes:
<script src="Scripts/jquery-3.4.1.min.js"></script> <script src="https://cdn.ckeditor.com/4.5.6/standard/ckeditor.js"></script> <textarea id="ta1" name="MyEA" runat="server"></textarea> <script> $(function () { CKEDITOR.replace('ta1', {readOnly:true}); CKEDITOR.replace('<%=ta1.ClientID.Replace("_","$") %>', { toolbar: 'Mybar' }); }) </script>
Best regards,
Yijing Sun
Friday, September 25, 2020 2:58 AM -
User364663285 posted
Hi,
Thanks. How to change value of readonly within one button-clicked event in the code-behind?
Friday, September 25, 2020 8:55 AM -
User1535942433 posted
Hi wmec,
How to change value of readonly within one button-clicked event in the code-behind?As far as I think,you cann't implement the effect.The CKEditor is API.It has defined in the front.You could use jquery button click to set readonly mode.
More details,you could refer to below article:
https://ckeditor.com/docs/ckeditor4/latest/features/readonly.html
Best regards,
Yijing Sun
Tuesday, September 29, 2020 8:46 AM -
User364663285 posted
How to achieve the same against my codes below?
<script type="text/javascript" src="<%= ResolveUrl("~/content/javascript/ckeditor/ckeditor.js") %>"></script> <script type="text/javascript" src="<%= ResolveUrl("~/content/javascript/ckeditor/adapters/jquery.js") %>"></script> <textarea id="ta1" name="MyEA" runat="server" ></textarea> <script type="text/javascript"> CKEDITOR.replace('<%=ta1.ClientID.Replace("_","$") %>', { toolbar: 'Mybar' }); </script>
Tuesday, September 29, 2020 9:16 AM -
User1535942433 posted
Hi wmec,
You could follow below codes:
<script type="text/javascript" src="<%= ResolveUrl("~/content/javascript/ckeditor/ckeditor.js") %>"></script> <script type="text/javascript" src="<%= ResolveUrl("~/content/javascript/ckeditor/adapters/jquery.js") %>"></script> <textarea id="ta1" name="MyEA" runat="server" ></textarea> <script type="text/javascript"> CKEDITOR.replace('<%=ta1.ClientID.Replace("_","$") %>', { toolbar: 'Mybar', readOnly: false }); </script>
Best regards,
Yijing Sun
Wednesday, September 30, 2020 8:05 AM -
User364663285 posted
Hi,
Can you help to one error happened below, on my page?
ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2 Uncaught TypeError: Cannot read property '_behaviors' of undefined at Sys.Extended.UI.CalendarBehavior.H.b.UI.Behavior (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2) at Function.H.z.initializeBase (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2) at Sys.Extended.UI.CalendarBehavior.Sys.Extended.UI.BehaviorBase (Default.aspx?_TSM_HiddenField_=ctl07_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.7.607%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3afc974eef-02bb-4a84-98bd-02b839b496d1%3ade1feab2%3afcf0e993%3af2c8e708%3a720a52bf%3af9cec9bc%3a589eaa30%3a698129cf%3afb9b4c57%3accb96cf9:19) at Function.H.z.initializeBase (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2) at new Sys.Extended.UI.CalendarBehavior (Default.aspx?_TSM_HiddenField_=ctl07_HiddenField&_TSM_CombinedScripts_=%3b%3bAjaxControlToolkit%2c+Version%3d4.1.7.607%2c+Culture%3dneutral%2c+PublicKeyToken%3d28f01b0e84b6d53e%3aen-US%3afc974eef-02bb-4a84-98bd-02b839b496d1%3ade1feab2%3afcf0e993%3af2c8e708%3a720a52bf%3af9cec9bc%3a589eaa30%3a698129cf%3afb9b4c57%3accb96cf9:37) at H.w.create (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2) at Array.<anonymous> (Default.aspx?user_id=6:281) at ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2 at Function.H.w.raiseEvent (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2) at H.b._Application._raiseInit (ScriptResource.axd?d=x6wALODbMJK5e0eRC_p1LdqkVSzSWOHw4d_i6VPAJ34TZ3W1P-X8d6ae2efeKo_MbJaOFzbpz3P1IjrmJw5GX4FAOPdKMQAN8f3S9QCFysG9Ago0bkvwoIHhqesvsJB30&t=ffffffffdc32f924:2)
Wednesday, September 30, 2020 9:29 AM -
User1535942433 posted
Hi wmec,
As far as I think,Though from the fact that it is ScriptResource.axd, you probably have something l which you don't want in an ASP script.
You could post your current codes to us.It will help us to solve your problems.
Best regards,
Yijing Sun
Wednesday, October 7, 2020 6:37 AM -
User364663285 posted
Hi,
Can you help and check project below?
https://1drv.ms/u/s!Ai8CrEskdewXumd_PNuvOpB_eein?e=H5dyGASunday, October 11, 2020 3:31 PM -
User1535942433 posted
Hi wmec,
Accroding to your codes,as far as I think,your problem isn't CKEditor but Calendar caused.
In your codes,you have comment CalendarExtender. However,html comment cann't comment server control.This may lead to unpredictable issues and interfere with your script logic. Also, any server-side evaluation code inside the comments is still being executed.
If you don't need to use CalendarExtender, you could delete it.
More details,you could refer to below article:
https://www.telerik.com/support/kb/aspnet-ajax/details/commenting-html-in-web-forms
Best regards,
Yijing Sun
Wednesday, October 14, 2020 7:51 AM