Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Jun 02, 2010 01:17 AM|LINK
Im not sure if there is an implementation of such converter, but the first idea that came up in my mind was this:
1. Speaking for web application (thats why this forum is) you will need to do it on client-side
2. On TextBox where you will type the key chars, you may use onKeyUp event.
Exmp: <asp:textBox id="myTxt1" runat="server" onkeyUp="doConvert(this)" TextMode="MultiLine" />
In the link above you have all the keyChars. If you open the VIEW SOURCE of the site, search for Press a key and you will come to the function that is used to find which key is pressed and how you can proceed. I would recommend here using SWITCH instead
of just if-s.
4. Then just replace it to the string
Exmp: in the function above doConvert(this) means Im passing the value of the object to the function, so you will have the latest text in the textbox, you will only need to get the last character of the string and convert it as per your needs.
You can get the last character of the string like int he following example
var length = d.value.length;
var lastCharacter = d.value.charAt(length - 1);
then you have the last char, using the code from the site above, you can catch which keyboard char is pressed and replace the char. as appropriate.
Hope this helps a bit.