locked
asp.net textbox with punjabi letter RRS feed

  • Question

  • User2062151828 posted

    hi friends,can anybody help me for a troubling job....i created one website in vs2008 (c#)...backend is sql2005....in my aspx page i have some text box control...i wants when type letter in that text box  should be typed in   punjabi  letters hopw i can do this work  please reply me .

    Tuesday, May 5, 2009 1:54 AM

Answers

  • User401360897 posted

     <input type="text" id="txt" onkeypress="return KeyDown(event)" />

     <script language="javascript">
    function KeyDown(e){

    var keynum;
    var keychar;
    if(window.event) // IE
      {
      keynum = e.keyCode;
      }
    else if(e.which) // Netscape/Firefox/Opera
      {
      keynum = e.which;
      }
    keychar = String.fromCharCode(keynum);
    if((keychar=='a') ||(keychar=='A'))
    document.getElementById('txt').value+='Pubjabi A Here';
    if((keychar=='b') ||(keychar=='B'))
    document.getElementById('txt').value+='Pubjabi B Here';//and so on
    return false;
    }
    </script>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, May 5, 2009 7:59 AM