Skip to main content
Level 4
Oct 16, 2015 2:29 AM UTC
Solved

trigger a function on text

Hi,

I need to check the text inserted into a richtext component. Is there a way to do it?

Can i do it via jsp or a js script inside a property?

For example i need a function that forces to uppercase the first letter when the user confirms the text.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

Hi,

Blur, Change, focus etc are the listerner that you can add to your Richtext,

Apart from that you can also add beforesubmit event listener to your dialog which will get fired when user click "Ok" on dialog.

KEEP In MIND,

Other fields like textarea, textfield contains only text, so it becomes easy to parse ...but in your case its richtext so you need to parse HTML+ TEXT

Let me know if you have any doubt.

2 replies

smacdonald2008
Level 10
Oct 16, 2015 2:29 AM UTC

See the  supported events in the RTE API docs:

http://docs.adobe.com/docs/en/cq/5-6-1/widgets-api/index.html?class=CQ.form.RichText

Translate
edubey
edubeyAccepted solution
Level 10
Oct 16, 2015 2:29 AM UTC

Hi,

Blur, Change, focus etc are the listerner that you can add to your Richtext,

Apart from that you can also add beforesubmit event listener to your dialog which will get fired when user click "Ok" on dialog.

KEEP In MIND,

Other fields like textarea, textfield contains only text, so it becomes easy to parse ...but in your case its richtext so you need to parse HTML+ TEXT

Let me know if you have any doubt.

Translate