I got not much clue about javascript, so i need help.
I get some result in PHP, something like this:
echo "Here is your result:<br/><input type='text' size='50' value='$final_result'>";
///// Need copy to clipboard BUTTON here for value $final_result
I've found some code on google, but got no clu how to use it.
<script language="JavaScript">
<!-- Begin
function copyit(theField) {
var tempval=eval("document."+theField)
tempval.focus()
tempval.select()
therange=tempval.createTextRange()
therange.execCommand("Copy")
}
// End -->
</script>
<form name="aspinc">
<pre>
<div align="center">
<input onclick="copyit('aspinc.select1')" type="button" value="Highlight All" name="cpy">
<p>
<textarea class="codebox-sm" name="select1">
Text you want to highlight goes here.
</textarea>
</p>
</pre>
</div>
</form>
where and how to place this javascript ?
It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!