Jump to content

Button to add text to PHP text box


vampiro2004

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/274685-button-to-add-text-to-php-text-box/
Share on other sites

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.