Here is my problem:
If I try to submit FCK form using javascript code, I have a JS exception.
Everything is ok if you click submit button.
Create a test.html file inside /_testcase and put the following HTML inside:
Am I wrong ?
Anyway, thanx guys ! FCK rulez !!
If I try to submit FCK form using javascript code, I have a JS exception.
Everything is ok if you click submit button.
Create a test.html file inside /_testcase and put the following HTML inside:
<html> <head> <script type="text/javascript" src="../fckeditor.js"></script> </head> <body> <form name="myform" action="#" method="post"> <script type="text/javascript"> var sBasePath = document.location.pathname.substring(0,document.location.pathname.lastIndexOf('_testcases')) ; var oFCKeditor = new FCKeditor( 'FCKeditor1' ) ; oFCKeditor.BasePath = sBasePath ; oFCKeditor.Create() ; </script> <input type="submit" value="Submit"> <a href="javascript:document.forms.myform.submit()">Click here to submit</a> </form> </body> </html>
Am I wrong ?
Anyway, thanx guys ! FCK rulez !!
RE: FCK 2.0FC: IE6 Javascript bug (Sample inside)
Note that Javascript Debugger must be enabled in Advanced Options Tab
RE: FCK 2.0FC: IE6 Javascript bug (Sample inside)
if (FCKBrowserInfo.IsIE)
{
var aCleanupDocs = new Array();
aCleanupDocs[0] = document;
function Window_OnBeforeUnload()
{
FCKToolbarSet.Collapse();
var e;
for (var j = 0; j < aCleanupDocs.length; j++)
{
var d = aCleanupDocs[j];
...
-> d is null is for some weird reasons
For people like me who :
-were waiting for a production version
-use javascript to post form instead of clicking submit button
, here is a quick fix:
replace
var d = aCleanupDocs[j];
with
var d = aCleanupDocs[j];
if (d == null) break;
href="javascript: ... Collapses Toolbar
<a class="ClearDataLink" href="javascript:showDatePicker('{Name}','{FormName}','{DateControl}');"><img....
The first time this link is clicked the Toolbar is collapsed and deleted.
Then when you actually leave the page that the Toolbar is on, the cleanup code is ran again but the Toolbar object doesn't exist and it throws an error.
sjanicaud's code fixes the second problem.
If I change the href=" to onClick=" I can get around the first problem.
Problem is I have a RAD tool called CodeCharge that creates these datapicker buttons with the href= automatically and I'll have to manually change them all each time I publish.
Also I expect other people are going to run into this problem. I am not sure how to have it distinguish between the different window_onunload events.
RE: href="javascript: ... Collapses Toolbar
<a href="javascrpt://" onclick="foo(); return false;">...</a>
The "return false;" at the end of the onclick method simply interrupts the click on the link. Thus, the unload() of the frame is not called.
Regards
Peter