|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
JavaScript - Change Languages
Hi! Remember me?
I need your help.. I have textboxes for greek description and I need when I make the focus on the textboxes the language become greek(without needed alt-shift). Is it possible? An something else.. I want something to transform my greek characters to english(greeklish). eg α=a, β=b, γ=g.. What I want to do is when someone is typing eg "ΚΑΛΗΜΕΡΑ" I want to insert in a DB the word "KALIMERA". Any suggestions? Thank you.. ![]()
__________________
I'm smarter in my mother tongue.
|
|
#2
|
||||
|
||||
|
Here's the solution:
Code:
<%
SET MyDictionary=CreateObject("Scripting.Dictionary")
MyDictionary.Add "α","a"
MyDictionary.Add "β","b"
MyDictionary.Add "γ","g"
MyDictionary.Add "δ","d"
MyDictionary.Add "ε","e"
MyDictionary.Add "ζ","z"
MyDictionary.Add "η","i"
MyDictionary.Add "θ","th"
MyDictionary.Add "ι","i"
MyDictionary.Add "κ","k"
MyDictionary.Add "λ","l"
MyDictionary.Add "μ","m"
MyDictionary.Add "ν","n"
MyDictionary.Add "ξ","ks"
MyDictionary.Add "ο","o"
MyDictionary.Add "π","p"
MyDictionary.Add "ρ","r"
MyDictionary.Add "σ","s"
MyDictionary.Add "τ","t"
MyDictionary.Add "υ","i"
MyDictionary.Add "φ","f"
MyDictionary.Add "χ","x"
MyDictionary.Add "ψ","ps"
MyDictionary.Add "ω","o"
MyDictionary.Add "ς","s"
Dim theString, theCounter, theOutput(), str, iLoop
theString = request.form("epitheto")&"_"&request.form("onoma")
ReDim theOutput(1)
For theCounter = 0 To Len(theString)-1
If theCounter > 1 AND theCounter <= Len(theString) Then ReDim PRESERVE theOutput(UBound(theOutput)+1)
theOutput(theCounter) = Mid(theString, theCounter+1, 1)
theOutput(theCounter)=MyDictionary.Item(theOutput( theCounter))
Next
For iLoop = LBound(theOutput) to UBound(theOutput)
str = str & theOutput(iLoop)
Next
%>
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > JavaScript - Change Languages |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|