iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2009, 12:58 PM
WebProWorld Pro
 
Join Date: Apr 2006
Location: Earth
Posts: 256
blitzen RepRank 0
Default WYSIWYG editor: change content of

I'm looking for a WYSIWYG plugin, preferably Javascript, to add to some textarea form elements.
However, I need a slick feature that works like this.

I display a form in my browser with a textarea form element.

There are selections that I can click that will fill in the textarea with text.
Each selection will put different text in the textarea.
This is written with Javascript to fill in the textarea element. E.g.,
document.getElementById('messagehtml').value = "This is the content that gets put into the text ares<br>Anyone can eat chocolate.";

I've tested some WYSIWYG text/html editors but haven't found any where I can click my selection to automatically fill in the textarea form element.
They all stay blank. I spent over a day testing these without success.
Yes, I used the correct form element Id in my Javascript command.
I don't cache pages so that the javascripts are reloaded with testing.

Here are what I tested so far
(1) openWYSIWYG v1.4.7 - this is close but I have to click the selection to fill in the form, then reload the page to get the form to have what the selection should put into it.
This has another problem with inserting a "<br>" when the form is submitted blank. I searched the code and can't find where in the code that does that.

(2) tinymce

(3) freerte_v1 - no go at all.

Can anyone help me find an appropriate WYSIWYG plugin that I can fill it in with content after loading the page?

Thanks!
__________________
Advertising without research is like shooting an arrow into the air and
then looking up for a target to catch it with.

Last edited by blitzen; 10-13-2009 at 01:00 PM. Reason: clarity
Reply With Quote
  #2 (permalink)  
Old 10-13-2009, 03:21 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 266
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: WYSIWYG editor: change content of

For a start - to change the content of the textarea within the form you need to use this

document.getElementById('myform').messagehtml.valu e = "Text content"

change myform to whatever your existing form id is.

Now come the questions.

Why do you think you need a WYSIWYG editor?
Why do you think you need to fill out a textarea?
__________________
There are 10 types of people in this world: those who understand binary and those who don't.
Reply With Quote
  #3 (permalink)  
Old 10-13-2009, 03:23 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 266
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: WYSIWYG editor: change content of

...and you'd think I'd know how to use this forum by now wouldn't you.
__________________
There are 10 types of people in this world: those who understand binary and those who don't.

Last edited by Uncle Dog; 10-13-2009 at 03:24 PM. Reason: I'm an idiot!
Reply With Quote
  #4 (permalink)  
Old 10-13-2009, 07:21 PM
WebProWorld Pro
 
Join Date: Apr 2006
Location: Earth
Posts: 256
blitzen RepRank 0
Default Re: WYSIWYG editor: change content of

Stupid Qwest. I just replied and their website came up telling me my wireless is stopping this month (everyone's at Qwest is). Then, I lost all my input to this form!

Anyway, in answer to your questions
1. The form data is used for website display and html emails.
2. For productivity. I send out emails with similar content. The form is automatically completed with the appropriate content. I then go in and customize it further.

And, the javascript I entered works as evidenced by it worked before installing the wysiwyg editor.
Your version gives me a null error (it is null).

Now, is there a way that I can use this editor and change the contents after the page is loaded?
__________________
Advertising without research is like shooting an arrow into the air and
then looking up for a target to catch it with.

Last edited by blitzen; 10-13-2009 at 07:26 PM.
Reply With Quote
  #5 (permalink)  
Old 10-13-2009, 07:38 PM
Uncle Dog's Avatar
WebProWorld Pro
 
Join Date: Apr 2008
Location: Scotland
Posts: 266
Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5Uncle Dog RepRank 5
Default Re: WYSIWYG editor: change content of

Yes - if I've understood what you are trying to do.

The contents of the textarea can be changed once a page has loaded using the method described before. You need to remember that the textarea belongs to the form which belongs to the document. So
document.getElementById('formId').textareaId.value = "Text" will change the textarea content. (change formId and textareaId to proper ids)

Obviously if you want to add to the content of the textarea you need something along the lines of

$variable = document.getElementById('formId').textareaId.value ;
$variable += "\nSome extra text on a new line";
document.getElementById('formId').textareaId.value = $variable;

If you need more, just ask. If I'm barking up the wrong tree, throw a stick.
__________________
There are 10 types of people in this world: those who understand binary and those who don't.
Reply With Quote
  #6 (permalink)  
Old 10-15-2009, 11:39 AM
WebProWorld Pro
 
Join Date: Apr 2006
Location: Earth
Posts: 256
blitzen RepRank 0
Default Re: WYSIWYG editor: change content of

Thank you for your quick replies.
Get the stick!
I was looking for the app and found one - tinyMCE does what I need and is very slick.
__________________
Advertising without research is like shooting an arrow into the air and
then looking up for a target to catch it with.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
What's an easy yet good WYSIWYG html editor to use Amus Graphics & Design Discussion Forum 31 05-18-2004 12:59 PM
WYSIWYG HTML editor - Cold Fusion blastradius Web Programming Discussion Forum 4 03-11-2004 01:19 PM
When can I see a change in SERP after changing the content? Ajiissac Search Engine Optimization Forum 0 02-02-2004 12:46 AM
ASP.net - FREE wysiwyg editor vfaulkner Web Programming Discussion Forum 0 01-30-2004 01:10 PM
Which wysiwyg HTML editor do you use? carbonize Graphics & Design Discussion Forum 18 09-24-2003 02:29 PM


All times are GMT -4. The time now is 03:47 AM.



Search Engine Optimization by vBSEO 3.3.0