javascriptvirtual-keyboard

Making own virtual keyboard


I want to make my own virtual keyboard using JavaScript.

Please tell me the syntax how to add characters to a TextBox. Adding the first character is easy but adding the second one I am unable to do.

Anybody please give a hint/logic to add text to textbox on keypress.


Solution

  • What Teneff said is the beginning.. this following code will be a hint for you..

    <form name="virtual">
    <input type="text" name="text"/>
    <input type="button" onclick="a()" value="a" style="border:none;"/>
    </form>
    <script type="text/javascript">
     function a(){
        document.forms["virtual"]["text"].value += "a";
    }
    </script>