vampiro2004 Posted February 19, 2013 Share Posted February 19, 2013 Hi, I am trying to create a button that will work with exsisting code to add input a line of text to a text box. this is the code where i want the text to go: <td width="16%" align="center">Address</td> <td width="84%" colspan="5"><input type="text" value="<?php echo $worksheet["CustomerAddress"]; ?>" name="worksheet_address" size="88"></td> </tr> I need a button that will put say " west midlands, blah, blah, blah" into the box, i have looked on the net before posting but couldnt seam to egt them to work with my code. TIA Quote Link to comment https://forums.phpfreaks.com/topic/274685-button-to-add-text-to-php-text-box/ Share on other sites More sharing options...
jacko_162 Posted February 19, 2013 Share Posted February 19, 2013 sounds like you need to use javascript to perform said action to fill in text area. you can use; <input type="button" onclick="document.getElementById('myTextArea').value += 'blah blah blah'" value="test" /> <textarea id="myTextArea"></textarea> here is a demo i found for you; jsfiddle Quote Link to comment https://forums.phpfreaks.com/topic/274685-button-to-add-text-to-php-text-box/#findComment-1413395 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.