Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.