Solved

fckeditor is not loading textarea

Posted on 2008-10-04
13
310 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

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 …
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.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…

724 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