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 Link to comment https://forums.phpfreaks.com/topic/76595-insert-at-cursor-position-alteration-to-existing-script/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.