On Tue, Aug 26, 2008 at 6:39 AM, Ravi Katta
<rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>
wrote:>
>
> 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?
>
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 Russell
Chief Evangelist, Partner
PLANET ARGON, LLC
design // development // hosting
http://www.planetargon.com/
http://www.robbyonrails.com/
aim: planetargon
+1 503 445 2457
+1 877 55 ARGON [toll free]
+1 815 642 4068 [fax]
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---