Solved

fckeditor is not loading textarea

Posted on 2008-10-04
13
307 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
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

827 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