Solved

tinyMCE with Text Area

Posted on 2008-10-28
4
902 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
  • 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

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

Suggested Solutions

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
This article covers the basics of the Sass, which is a CSS extension language. You will learn about variables, mixins, and nesting.
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)
The viewer will learn the basics of jQuery including how to code hide show and toggles. 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…

919 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

20 Experts available now in Live!

Get 1:1 Help Now