Solved

fckeditor is not loading textarea

Posted on 2008-10-04
13
298 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
 

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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

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 …
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now