Validate the tinyMce textarea

Hi,

  i am using the tinyMce text editor in my rails app.But how to

write the java script validation for that textarea?

my validation is:

  In that textarea all numbers are not allowed.

I am getting the data from textarea using
tinyMce.get(“id”).getContent().
but i am getting

1234

this data from above code.

i dont want any html tags.i want only data what we entered in textarea.
how to get that data?

thanks,
Ravi.

On Tue, Aug 26, 2008 at 6:39 AM, Ravi K.
[email protected] wrote:

I am getting the data from textarea using
tinyMce.get(“id”).getContent().
but i am getting

1234

this data from above code.

i dont want any html tags.i want only data what we entered in textarea.
how to get that data?

Ravi,

First off, this would probably be a better question for a Javascript
mailing list as this isn’t really a rails-specific question.

In an effort to help you out, you’ll probably want to look at building
an observer with javascript (using prototype.js) and validate that
characters are non-numeric. I’m not sure how TinyMCE works completely,
but it sounds like it’ll generate the html as you’re using it but I’d
suspect that it’d key a variable in it’s namespace with the original
content so that it could continue to reformat properly. Perhaps it’s
has an html escape function that you could call to strip out the html.

Anyhow, that’s how I’d go about looking to create a solution to your
goal.

Cheers,
Robby


Robby R.
Chief Evangelist, Partner

PLANET ARGON, LLC
design // development // hosting


http://www.robbyonrails.com/
aim: planetargon

+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]