Link to home
Start Free TrialLog in
Avatar of tashsmith
tashsmith

asked on

L Script to add html code before and after text in a RTF field

I have a body field that users write articles in.

I would like to be allow them to highlight some text and run a script, the script would add [<div class="special">] at the start and [</div>] at the end.

So something like this

some textsome textsome text some text some textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome text
some textsome
[<div class="special">] textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome[</div>]

 textsome textsome textsome textsome textsome textsome textsome textsome textsome textsome text


I do not want to use styles and I want to retain global control over these articles that finally make their way to a website.

Any ideas anyone?

Ta


Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

That's going to be a very tough one, I think... So it's in a browser? The rich-text field, is it a standard <textarea>, a Java applet or some other solution? What do you see when you look at the page source, in HTML??

No styles?? Then what does class="special" mean???
SOLUTION
Avatar of madheeswar
madheeswar
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Browser... :-|
Avatar of tashsmith
tashsmith

ASKER

ok i need to give you guys mor info...

the notes database is a content management system, people are attached through notes clients not a browser..

the rtf field is translasted into html as it goes through domino for publishing.

i would like to be able to in notes allow users to wrap some html around certain paragraphs hence the [], so domino knows it is html.
that way when it reaches the website i can control it look and feel in the global .css file.

ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
hahaha superb!!!!!

It worked first off, legend sjef!

Enjoy the points..
>>Maddy, you were right once again.

Sjef, you got all the points once again.

:(
Okay, you have a point there, Madheeswar... I maybe shouldn't have given the code, so Tash would have had to look it up for her(?)self. I'll butt out for a while, and you should check your mail more often.

Im not understanding the politics of this at all, but gave the points to Sjef as he (?) provided me with the solution.
Madheeswar, I apologise if you feel you have been unjustifiably denied points and since Sjef feels you have a point, I will request to re-allocate points accordingly.

Thanks for your help chaps!

and yes sjef I am a girl!
As opposed to you, I do have an EE-profile... ;-))