Canman2005 Posted November 9, 2007 Share Posted November 9, 2007 Hi all I have a simple form which has two buttons and a form field, when you click one of the two buttons, it inserts the value of the selected button into the form field. The code is <form> <input type="text" name="tester"> <input type="button" value="1" onclick="tester.value+='1'"> <input type="button" value="2" onclick="tester.value+='2'"> </form> At the moment, when you click one of the two buttons, it always inserts the value at the end of whatever has already been entered in the text field. I want to change this, so that it inserts the button value into the text field, but at the position of where the text cursor is blinking. Can this be done?? Hope that makes sense Any help would be gratefully appreciated. Thanks in advance Thak Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.