Using CKEditor 3.5.3 on Internet Explorer 7.
This javascript error has been popping up and it's been driving me crazy. I've finally narrowed the code down to the problem:
If there is a select element in a form with the CKEditor in BR enterMode, and the select element is the first thing you pull down, you will get a javascript error.
Javascript Error Message:
Line: 97
Char: 812
Error: 'D.getSelection()' is null or not an object.
Notes:
- This javascript error only happens if you try to pull down the select box first. If you focus somewhere else first, this message will not pop up.
- It is always the same line and char number no matter where you put the code.
- This also happens if you set the enterMode to DIV. Does not happen if set to P.
Help!
This javascript error has been popping up and it's been driving me crazy. I've finally narrowed the code down to the problem:
If there is a select element in a form with the CKEditor in BR enterMode, and the select element is the first thing you pull down, you will get a javascript error.
<html><head> <script type="text/javascript" src="/ckeditor/ckeditor.js"></script> </head><body> <form name="MyForm"> <select name="edtSelect"> <option value="One">One</option> <option value="Two">Two</option> <option value="Three">Three</option> </select> <textarea name="edtTextArea">Hello There</textarea> <script type="text/javascript"><!-- CKEDITOR.replace('edtTextArea', { enterMode: CKEDITOR.ENTER_BR }); //--></script> </form> </body></html>
Javascript Error Message:
Line: 97
Char: 812
Error: 'D.getSelection()' is null or not an object.
Notes:
- This javascript error only happens if you try to pull down the select box first. If you focus somewhere else first, this message will not pop up.
- It is always the same line and char number no matter where you put the code.
- This also happens if you set the enterMode to DIV. Does not happen if set to P.
Help!
Re: enterMode BR + SELECT element = Javascript Error
I have reported a bug based on your post - https://dev.ckeditor.com/ticket/7865
Thank you for bringing this to our attention.
Re: enterMode BR + SELECT element = Javascript Error
BTW, the workaround is to set focus on another element first. I had multiple textboxes on the screen so I was able to set focus to the first one and that seems to prevent the error message from coming up.