Click checkbox and change font of the page

Click checkbox and change font of the page

I have used one rtf field to input some details that are in both English and Tamil. When I copy and paste the details from some other file (doc file) it displays it as is (if it is English, English or if it is Tamil, Tamil) in Notes client.

I am using another form to display this content on the Web. English is displayed well, but Tamil takes some other font display as unknown characters. If I use a font tag before this field then it is ok, but I have check English and Tamil. If I select English, the content should be in English .If select Tamil, the content should be in Tamil. How can I do this?

    Requires Free Membership to View

    Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.

    By submitting your registration information to SearchDomino.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of SearchDomino.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

If I understand your question correctly, I believe you want users to be able to click a checkbox and change the font of the page.

You should be able to do this with Dynamic HTML (DHTML) on the page, using JavaScript and CSS.

Below is a sample function that changes fonts when a link is clicked. To adapt it for your use, change the function calls in the links to pass the name of the fonts that you need to use. Also, make sure the text is enclosed in a DIV or SPAN tag with the ID "Content" (or change the JavaScript function to point to a different HTML element name).

<HTML>
<HEAD>
<SCRIPT>
function SetFont (FontName) {
 document.all.Content.style.fontFamily
 = FontName;
}
</SCRIPT>

</HEAD>
<BODY>

<A HREF="#" onClick=
"SetFont('Arial')">Set font to Arial</A>
<BR>
<A HREF="#" onClick=
"SetFont('Verdana')">Set font to Verdana</A>
<BR><BR>

<DIV ID="Content">
The font of this text will
 change when a link above is clicked.
</DIV>

</BODY>

Do you have comments on this Ask the Expert question and response? Let us know.

This was first published in February 2005