PDA

View Full Version : Is this possible?


anandc
10-06-2002, 07:26 PM
hi

I m attaching a text file in which i have described what i want.
As it is not possible to attach HTML files I have used TXT file. Save it as HTML and then have a look.
Please tell me whether it is possible with same page

Thks in advance

x_goose_x
10-06-2002, 08:45 PM
You have two forms with the same name (form1). You need to change this.


document.form1.BName.style.fontFamily=document.form1.select1.options[document.form1.select1.selectedIndex].value;

anandc
10-07-2002, 04:25 PM
Hi goose,

Take a good look. One side is for INDIANS (as what I want is that
the Font Family of the Text Box should get changed to an Indian
Language which NON- INDIANS cant undestand) and other one is for NON-INDIANS.
Only consider it as one problem. If you can solve either I will get my solution anyhow.


Anand

premshree
10-07-2002, 07:43 PM
Try this Code :

I did not have any Hindi fonts, so I used the more common fonts.
To include Hindi fonts, just change the value in <option value="fontName">fontName</option> to whatever font you want.


<html>
<head>
<title>Language Selection</title>
</head>
<body bgcolor="#FFFFFF">

<script language="JavaScript">
function changeFont()
{
var font=document.form1.select1.options[document.form1.select1.selectedIndex].value;
document.form1.name.style.fontFamily=font;
document.getElementById('fontSpace').innerHTML='You selected : ' + '<font face="' + font + '"><b>' + font + '</b></font>';
}
</script>

<div id="fontSpace" style="font-family:verdana,arial,helvetica; font-size:10pt"></div>

<form name="form1">
<table style="background:#EFEFF5; border:#000000 solid 1px">
<tr>
<td>
<font face="verdana" size="2" color="#0000FF">Font Family</font>
</td>
<td>
<select name="select1" onChange="changeFont()">
<option>Select the Option</option>
<option value="Comic Sans MS">Comic Sans MS</option>
<option value="Times New Roman">Times New Roman</option>
<option value="Arial">Arial</option>
<option value="Verdana">Verdana</option>
</select>
</td>
</tr>
<tr>
<td>
<font face="verdana" size="2" color="#0000FF">Name</font>
</td>
<td>
<input type="text" name="name" style="font-weight:bold">
</td>
</tr>
</table>
</form1>

</body>
</html>


:thumbsup:

anandc
10-08-2002, 06:16 AM
Hi premshree,

Thks a lot for ur right and quick help.

Thks a lot


Have a nice day

Anand