Hi,

i have two input box

input box 1 : name is first

input box 2 : name is second

suppose if i enter "fresh" should be transliterated using google and the output in french should be displayed in the second input box.

does anyone have any idea how to do this???

Recommended Answers

All 2 Replies

If you are going to use google, you need their API (javascript library). Not sure if they have this library available.

thanks for replying.


the google API is available...

the transliteration library actually does not support French so we can use Greek language

please check the code below

<html>
<head>
<title> Transliteration Help </title>
<script type="text/javascript" src="http://www.google.com/jsapi"></script>

<script type="text/javascript">
google.load("elements", "1", {packages: "transliteration"});
</script> 

<script>
function OnLoad() {
	var currValue = document.getElementById("second");

	var options = {
		sourceLanguage:
		google.elements.transliteration.LanguageCode.ENGLISH,
		destinationLanguage:
		[google.elements.transliteration.LanguageCode.GREEK],
		shortcutKey: 'ctrl+g',
		transliterationEnabled: true
	};

	var control = new
	google.elements.transliteration.TransliterationControl(options);
	control.makeTransliteratable(["second"]);
	var postValue = document.getElementById("second");

	}

	google.setOnLoadCallback(OnLoad);

</script> 

<script type="text/javascript">
function tcall()
	{
		document.getElementById('second').value = document.getElementById('first').value;
	}
	
	
</script>

</head>
<body>
<br>
Translietration test.
<br><br><center>


	<form name="trans">First Box
		<input size="40" type="text" id="first" name="first" onkeydown="javascript: tcall();" onkeyup="javascript: tcall();"  />

		<br /><br />Second Box
		<input size="40" type="text" id="second" name="second"  />

	</form>

<br /><br />transliterated text should be there in the second box.

</body>
</html>

i hope this may help proceed further.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.