0

is there any chance that i can create copy button in php or html which allows me to copy to clip board without using javascript or jquery - please help me with any reference links - below the code

<td>Latest investigation timestamp:</td>
   
<td><input type="text" value="<?php echo $_POST['map']; ?>" readonly="" style="
height: 31px;
width: 320px; "> 
</td>
  
</tr>
  
<tr>
    
<td>User story: </td>
    
<td><input type="text" value="<?php echo $_POST['story']; ?>" readonly=""  style="
height: 64px;
width: 320px; "> 
</td>
  
</tr>
  
<tr>
    
<td>Checkbox explanation: </td>
    
<td><textarea  readonly="readonly" style="
height: 240px;
width: 320px; "><?php echo $_POST['type_rejects'];?></textarea>  </td>
  
</tr>
  • 2
    Without using JS? Tough luck. JS is a client-side language and any kind of interaction you want has to be done through JS. Even if you want to use JS, clipboard access varies from one browser to another: the safest bet is still to let the user copy something manually, but with some helper functions (like highlighting the content to be copied when the user hovers/clicks and etc, and with a tooltip informing them to use Ctrl/Cmd+C to copy) – Terry May 07 '16 at 21:22
  • You'll need js (or possibly flash, but who uses that nowadays). The easiest way I know of is to use this tool: https://clipboardjs.com/ – Pevara May 07 '16 at 21:29
  • check here for a more thorough answer -- http://stackoverflow.com/questions/22581345/click-button-copy-to-clipboard-using-jquery – Tasos May 07 '16 at 21:33
  • Short answer -> **no**! Even when using Flash you'll need javascript to fire the swf. – adeneo May 07 '16 at 21:34
  • 1
    Any particular reason not to use JS? – Algernop K. May 07 '16 at 21:49

0 Answers0