Solved

fckeditor is not loading textarea

Posted on 2008-10-04
13
302 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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 …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to count occurrences of each item in an array.
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.

911 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

23 Experts available now in Live!

Get 1:1 Help Now