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 <p>1234</p> 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.

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