Solved

fckeditor is not loading textarea

Posted on 2008-10-04
13
308 Views
Last Modified: 2008-10-04
I am integrating an FCKEditor in my page in PHP. The editor is not loading the textarea (the actual editor window). The toolbar loads, but when i go to click on the textarea, nothing happens, it does not gain focus.
$oFCKeditor = new FCKeditor('newcontent') ;
$oFCKeditor->ToolbarSet = 'CustomToolbar';
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = 'Edit this.';
$oFCKeditor->Width = '90%';
$oFCKeditor->Create() ;

Open in new window

0
Comment
Question by:jonarc124
  • 7
  • 6
13 Comments
 
LVL 9

Expert Comment

by:khaledf
ID: 22643086
have you tried to run any of the samples that come with FCKeditor? does it work?
0
 

Author Comment

by:jonarc124
ID: 22643176
Yes, the PHP samples work..
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22643219
can you attach the page that should display the editor in it?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:jonarc124
ID: 22643229
This is a test page (the actual page is a nested include file, so is too long). The test page has the same problem though.
<? include_once("fckeditor/fckeditor.php") ; ?>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
 
<body>
<form>
<?php
$oFCKeditor = new FCKeditor('asdf') ;
$oFCKeditor->ToolbarSet = 'CustomToolbar';
$oFCKeditor->BasePath = 'fckeditor/' ;
$oFCKeditor->Value = 'test';
$oFCKeditor->Width = '350px';
$oFCKeditor->Create() ;
?>
</form>
</body>
</html>

Open in new window

0
 
LVL 9

Accepted Solution

by:
khaledf earned 500 total points
ID: 22643250
try adding forward slash here
$oFCKeditor->BasePath = 'fckeditor/' ;

to be like
$oFCKeditor->BasePath = '/fckeditor/' ;

also try commenting this line
$oFCKeditor->ToolbarSet = 'CustomToolbar';

see if it works now.
0
 

Author Comment

by:jonarc124
ID: 22643282
Yes, that solves the textarea issue. However, when I try to uncomment the custom toolbar line, it says my toolbar doesnt exist even though i have it defined in fckeditor/fckconfig.js.
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22643341
glad it is working

try clearing browser cache.

still not working?
0
 

Author Comment

by:jonarc124
ID: 22643373
Still not working
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22643463
where is the javascript file located?

try putting the base path before the toolbarset like this

$oFCKeditor->BasePath = '/fckeditor/' ;
$oFCKeditor->ToolbarSet = 'CustomToolbar';

0
 

Author Comment

by:jonarc124
ID: 22643466
test.php is in root directory. config js file is at fckeditor/fckeditor.js.  putting the base path set line before the toolbar set line doesnt do anything. also fyi, i tried deleting the whole folder and "reinstalling" but to no avail.
0
 
LVL 9

Expert Comment

by:khaledf
ID: 22643478
does this toolbarset work?
$oFCKeditor->ToolbarSet = 'Basic';
0
 

Author Comment

by:jonarc124
ID: 22643488
yes, default and basic work. my code found in the config js file is below.
FCKConfig.ToolbarSets["Default"] = [
	['Source','DocProps','-','Save','NewPage','Preview','-','Templates'],
	['Cut','Copy','Paste','PasteText','PasteWord','-','Print','SpellCheck'],
	['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
	['Form','Checkbox','Radio','TextField','Textarea','Select','Button','ImageButton','HiddenField'],
	'/',
	['Bold','Italic','Underline','StrikeThrough','-','Subscript','Superscript'],
	['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','CreateDiv'],
	['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
	['Link','Unlink','Anchor'],
	['Image','Flash','Table','Rule','Smiley','SpecialChar','PageBreak'],
	'/',
	['Style','FontFormat','FontName','FontSize'],
	['TextColor','BGColor'],
	['FitWindow','ShowBlocks','-','About']		// No comma for the last row.
] ;
 
FCKConfig.ToolbarSets["Basic"] = [
	['Bold','Italic','-','OrderedList','UnorderedList','-','Link','Unlink','-','About','Cut','Copy']
] ;
 
FCKConfig.ToolbarSets["CustomToolbar"] = [
	['Source','Cut','Copy','Paste','SpellCheck','Undo','Redo','SelectAll'],
	'/',
	['Image','-','Bold','Italic','Underline','StrikeThrough','Subscript','Superscript','RemoveFormat'],
	'/',
	['OrderedList','UnorderedList','-','Outdent','Indent','Blockquote','Link','Unlink','SpecialChar']	// No comma for the last row.
] ;

Open in new window

0
 
LVL 9

Expert Comment

by:khaledf
ID: 22643522
tried it  and it works perfectly with FCKeditor_2.6.3
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question