Solved

tinyMCE with Text Area

Posted on 2008-10-28
4
920 Views
Last Modified: 2013-11-19
In a php page i have three textarea, and many client create four more(I done it with DOM). And i want to assign tinyMCE to all the text areas, that was sucessfull. But the issue is  i can't get the values from the textarea using javascript.

When i used this command   alert(document.getElementById('txt1').value);
the result is empty, but the textarea having value. When i post the page i got the values from all textarea. But i need client side validation to check datas are entered in textarea.

Pls help
0
Comment
Question by:logicslab
[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
  • 2
  • 2
4 Comments
 
LVL 2

Expert Comment

by:quetzal22
ID: 22828849
From what I see here:
http://tinymce.moxiecode.com/examples/example_06.php

it seems that if your textarea has name="myEditor" then you will need to do:
var ed = tinyMCE.get('content');

//then to find out the value of it
alert( ed.getContent() );

//then if you want to change the value of it
ed.setContent('Hello');
0
 

Author Comment

by:logicslab
ID: 22828974
Hi quetzal22

thank you for your quick reply.
 
One more question about tinyMCE. How can i add Mathematical Symbols to textarea using tinyMCE?
0
 
LVL 2

Accepted Solution

by:
quetzal22 earned 500 total points
ID: 22829000
The "Full Featured" example:
http://tinymce.moxiecode.com/examples/full.php

shows you all the supported features. Mathematical symbols are not an option. TinyMCE is an HTML editor. HTML does not support Mathematical symbols (they never thought about that until later - then they came up with MathML - http://www.w3.org/Math/). You may want to ask the TinyMCE folks if they intend to add that support.
0
 

Author Closing Comment

by:logicslab
ID: 31511060
Thank you very much
0

Featured Post

Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface In the first article: A Better Website Login System (http://www.experts-exchange.com/A_2902.html) I introduced the EE Collaborative Login System and its intended purpose. In this article I will discuss some of the design consideratio…
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

688 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