CodeCharge Studio
search Register Login  

Visual PHP Web Development

Visually Create Internationalized Web Applications, Web Reports, Calendars, and more.
CodeCharge.com

YesSoftware Forums -> Archive -> GotoCode Archive

 Wysiwyg editor

Print topic Send  topic

Author Message
Karen
Posted: 03/19/2003, 6:34 AM

I've integrated htmlarea into my page and it is working very well except when there is an error on the form. When the error message is displayed, prompting the user to correct their input(s), the textarea (with htmlarea) becomes a label. It has been defined as a label/html and then in Before Show event, it is set to be a textarea. I guess my problem is to get the code in Before Show to be executed each time there is an input error.

I'm using CC2.05 with PHP/MySQL. I would appreciate if anyone can provide some tips. Thanx very much.
RonB
Posted: 03/19/2003, 11:40 AM

why would you want to set it as a label to change it to textarea wiht before show?

Ron
bsiler
Posted: 03/19/2003, 1:20 PM

Good info at this site: http://www.rexdesign.com/ccs/default.php

This is how to implement the excellent htmlarea (free WYSIWYG Editor) JavaScript in your CCS Project :

First copy the unaltered htmlarea folder to just under your CCS project root (so CCS will upload it to server)
example == MyCCSproject/htmlarea/

Once htmlArea is in your CCS project all you need to do is add some JavaScript to any pages that you want to add WYSIWYG editors to. Here's how to do that.


Open the page you want to add a WYSIWYG editor to. Add the following to the top of the page in the <head></head> of the HTML document.
<script language="Javascript1.2"><!-- // load htmlarea
_editor_url = "htmlarea/"; // URL to htmlarea files
var win_ie_ver = parseFloat(navigator.appVersion.split("MSIE")[1]);
if (navigator.userAgent.indexOf('Mac') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver = 0; }
if (navigator.userAgent.indexOf('Opera') >= 0) { win_ie_ver = 0; }
if (win_ie_ver >= 5.5) {
document.write('<scr' + 'ipt src="' +_editor_url+ 'editor.js"');
document.write(' language="Javascript1.2"></scr' + 'ipt>');
} else { document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// --></script>
If you've installed htmlArea anywhere other than /htmlarea/ then be sure to change _editor_url to point to your htmlarea directory (ending with a forward slash "/").

For each <textarea> that you want to change, add the following code to the page.
<script language="JavaScript1.2" defer>
editor_generate('fieldname');
</script>

Be sure to change "fieldname" to be the name (not id) of the textarea you want to change.

And you're done, open your page in your browser and see if it worked.
Download the example CCS project from the link above. The archive is in PHP but as no Custom Code is used the example can be changed to any CCS-supported language. You must have the example database table *articles* (from CCS Examples) deployed to use this example.

The popups directory is a very good place to code your extentions to htmlarea, please see RonBs article for a supercharged version of the popup directory, but it would be adviseable to get the original working first as per the above.

Karen
Posted: 03/19/2003, 11:38 PM

I referred to the tips/articles section. Since I'm using CC instead of CCS, I think I can't edit the textarea properties within CC, can I? That's why I have to define it as a label field and then in the Form Before Show event, change it to textarea followed by the editor_generate code.

I noticed that this was mentioned, can this be done in CC (not CCS)?
---------------------
For each <textarea> that you want to change, add the following code to the page.
<script language="JavaScript1.2" defer>
editor_generate('fieldname');
</script>
---------------------

Where do I place this code if can be done in CC? It would save a lot of hassle if I don't have to define it as a label field first since I also have to edit the insert and update SQL to include the field in question. To know what I mean, take a look at the tips/articles section on this. I followed the instructions there and was very happy to get it working. But now I have to fix this on error situation. Any help is much appreciated. Thanx.
bsiler
Posted: 03/20/2003, 9:54 AM

Karen,

I am not quite sure what is happening. If you emailcodechargehelp@yahoo.com I will reply with a number you can reach me at and we can discuss the issue and try to help to resolve. I feel that this could be the quickest way.
Tony M
Posted: 03/20/2003, 12:26 PM

Whilst anxiously awaiting..."the planned official Studio 2.0 release to be announced by March 22nd"
I was slightly amused but mystified by the Author "bsiler"
It is a new name to me on this forum...BUT "bsiler" is obviously a very experienced and knowledgeable Studio user...In fact he reads and sounds very much like our own FAMOUS "Dave Rexel"

Have you got married Dave...and rather unusually...taken you wife's name?
or is someone imitating you...
Will the real Dave Rexel...please confirm or deny the bsiler posts.

A slightly amused but mystified
Tony M
RonB
Posted: 03/20/2003, 12:54 PM

just create a record, making the content field a textarea=>for example

tabel: news(news_id, news_title, news_date,news_content)
news_id(not on the record because it's the primary key and gets auto incremented)
news_title(textbox)
news_date(date)
news_content(textarea)

now in html just after the <input type=textarea id=....etc
you paste the folowing

<script language="JavaScript1.2" defer>
editor_generate('news_content');
</script>

now when you load the page the textarea news_content will be changed into htmlarea editor.

Ron
bsiler
Posted: 03/20/2003, 2:15 PM

Tony M,

I have been using CodeCharge(XX) for several years, I think I was buyer 50 or some number close to it and never really participated in the Community. Being laid off since Jan. 2003 you can see I have a lot of time on my hands. Although I do not have all the answers, and I may give miss information at some point, I like trying to help other solve problems. Keeps me busy since there is no real work for me to do. So to clarify, I am not Dave, but if he brought value to the community I only hope I can do the same. Every need to get me directly emailcodechargehelp@yahoo.com. I'm looking for work!!!

bsiler
DaveRexel
Posted: 03/20/2003, 11:17 PM

Hi folks,

Here's the real Dave waving and smiling at TonyM. No TonyM I'm not married, every girlfriend I have had has paled at the sight of innumerable machines, wires, screens and blinking panellights that crisscross my house.

My present gf travels a lot so she is not irritated by my constant working (yet)... LOL

The posts by bsiler have so impressed me so much that I have added him to the KB-editors group at rexdesign KB - welcome bsiler, I feel you will be a valuable resource for CCS users.

Greetings
Dave
bsiler
Posted: 03/21/2003, 12:00 AM

Thanks Dave, I only hope I can provide the level of expertise or help to an acceptable standard and I did get your email and look forward to posting How-To's and snippets for others to use.

Becoming recently unemployed, one looks for ways to fill the day. I can only clean the house so much, dirty cloths just so I can wash them and fix fine dinners for the Miss's, I have run out of receipes.

Tony M
Posted: 03/21/2003, 4:52 AM

I'm still not convinced...BUT...I'm still amused :-))
...and this Forum certainly needs some HUMOUR...whilst we wait for Studio Two.

It's almost here...and I'm looking forward to the promised "Detailed Documentation and Examples"...because like YesSoftware I must also earn a living...from those countless organisations...that have a need...for Web Applications.

Have a nice weeekend everyone.
Tony M

Karen
Posted: 03/29/2003, 6:27 AM

Thanx to RonB and bsiler, it is now working as required. Defining the field as textarea and editing the html is easier than defining it as label and editing the custom action and before show events. Thanx very much.

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.