Fala pessoal !!! O script que foi mandado estava apenas copiando, mas não colava. Chamando uma outra função, consegui fazer colar dentro do input selecionado. Façam um teste e me avisem ... Abraços
<html>
<head>
<title>Botao direito</title>
<head>
<style type="text/css">
<!--
body { font: 80% verdana; }
#menu {
display: none;
position: absolute;
top: 10px;
left: 10px;
width: 100px;
cursor: default;
padding: 5px 2px;
font-size: 11px;
background-color: menu;
border: 2px outset;
}
#menu a {
display: block;
width: 100%;
cursor: default;
padding: 1px 5px;
text-decoration: none;
color: #000000;
}
#menu a:hover {
background-color: highlight;
color: #ffffff;
}
-->
</style>
<script type="text/javascript">
var obj;
function clickMouse(evt) {
if (evt.srcElement) {
if (evt.srcElement.type == "text") {
obj = evt.srcElement;
}
}
}
function exec(c, i, v) {
var sel = document.selection.createRange();
document.execCommand(c, i, v);
ocultar();
}
function exec2(c, i, v) {
obj.focus();
var sel = document.selection.createRange();
document.execCommand(c, i, v);
obj.focus();
ocultar();
}
function mostrar() {
if (document.all) {
coordX = event.clientX;
coordY = event.clientY;
event.returnValue = false;
} else {
coordX = e.pageX;
coordY = e.pageY;
event.returnValue = false; // Arrumar aqui para Mozilla, Opera
}
menu.style.display = "block";
fadeIn();
menu.style.top = coordY;
menu.style.left = coordX;
}
function fadeIn(a) {
if (a == null) { a = 0; }
menu.style.filter = "alpha(opacity=" + a + ")";
if (a < 100) {
setTimeout("fadeIn(" + (a+10) + ")", 30);
} else {
menu.style.filter = "";
}
}
function ocultar(a) {
// cria um fade out
if (a == null) { a = 100; }
menu.style.filter = "alpha(opacity=" + a + ")";
if (a > 0) {
setTimeout("ocultar(" + (a-10) + ")", 20);
} else {
menu.style.display = "";
}
}
document.oncontextmenu = mostrar;
document.onclick = ocultar;
</script>
</head>
<body>
<pre>
Please note that users of Microsoft Windows XP with <b>Service Pack 2</b> will need to unblock
this page in order to see the menu.
The reason for this is due to the fact that the menu has been written in JavaScript.
This feature is considered unsafe when used locally and Service Pack 2 now blocks this by
default for your safety.
This only happens when you run the menu on a local machine, live use on the Internet will not
be affected.
<input type="text" name="teste" onclick="clickMouse(event);" />
</pre>
<div id="menu">
<a href="javascript:;" onclick="exec('Copy');" title="Copiar (Ctrl+C)">Copiar</a>
<a href="javascript:;" onclick="exec('Cut');" title="Recortar (Ctrl+X)">Recortar</a>
<a href="javascript:;" onclick="exec2('Paste');" title="Colar (Ctrl+V)">Colar</a>
</div>
</body>
</html>