﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
2180	Display simple textarea if javascript is disabled	Wiktor Walc		"If javascript is disabled in FCKeditor compatible browser, most of the time nothing appears to the end user (neither FCKeditor nor simple textarea).


The only example that works with javascript disabled is sample02.html.


I belive that many people use server side integration and are unaware of this problem. Below is a simple work-around for this issue:

{{{
public function CreateHtml()
{
	$HtmlValue = htmlspecialchars( $this->Value ) ;

	$Html = '' ;

	if ( strpos( $this->Width, '%' ) === false )
	$WidthCSS = $this->Width . 'px' ;
	else
	$WidthCSS = $this->Width ;

	if ( strpos( $this->Height, '%' ) === false )
	$HeightCSS = $this->Height . 'px' ;
	else
	$HeightCSS = $this->Height ;

	if ( $this->IsCompatible() )
	{
		if ( isset( $_GET['fcksource'] ) && $_GET['fcksource'] == ""true"" )
		$File = 'fckeditor.original.html' ;
		else
		$File = 'fckeditor.html' ;

		$Link = ""{$this->BasePath}editor/{$File}?InstanceName={$this->InstanceName}"" ;

		if ( $this->ToolbarSet != '' )
		$Link .= ""&amp;Toolbar={$this->ToolbarSet}"" ;

		// Render the linked hidden field.
		$Html .= ""<input type=\""hidden\"" id=\""{$this->InstanceName}\"" name=\""{$this->InstanceName}\"" value=\""{$HtmlValue}\"" style=\""display:none\"" />"" ;

		// Render the configurations hidden field.
		$Html .= ""<input type=\""hidden\"" id=\""{$this->InstanceName}___Config\"" value=\"""" . $this->GetConfigFieldString() . ""\"" style=\""display:none\"" />"" ;

		// Render the editor IFRAME.
		$Html .= ""<iframe style=\""display:none\"" id=\""{$this->InstanceName}___Frame\"" src=\""{$Link}\"" width=\""{$this->Width}\"" height=\""{$this->Height}\"" frameborder=\""0\"" scrolling=\""no\""></iframe>"" ;

		// If JavaScript is enabled, make iframe above visible
		$Html .= ""<script type=\""text/javascript\"">"" ;
		$Html .= ""<!--\n"";
		$Html .= ""document.getElementById('{$this->InstanceName}___Frame').style.display='';"";
		$Html .= ""\n//-->"";
		$Html .= ""</script>"" ;

		//If JavaScript is disabled, display simple textarea and leave iframe invisible
		$Html .= ""<noscript>"";
		$Html .= ""<textarea name=\""{$this->InstanceName}\"" rows=\""4\"" cols=\""40\"" style=\""width: {$WidthCSS}; height: {$HeightCSS}\"">{$HtmlValue}</textarea>"" ;
		$Html .= ""</noscript>"" ;
	}
	else
	{
		$Html .= ""<textarea name=\""{$this->InstanceName}\"" rows=\""4\"" cols=\""40\"" style=\""width: {$WidthCSS}; height: {$HeightCSS}\"">{$HtmlValue}</textarea>"" ;
	}

	return $Html ;
}
}}}

I know it's ugly but it seems to work. The problem is that the same value ($HtmlValue) is posted twice for textarea and hidden field. I'm not sure whether there is a way to copy this value from textarea in `<noscript>` tag to a hidden field.

Do you have any other proposals?"	New Feature	closed	Normal		General		fixed	Confirmed	
