Y
Yoni
Hey All, Ive been looking for hours trying to search for a fix for
this. I want to click to copy a Hidden Field. I have the following
script but when hidding the field it says it wont work. Any
Ideas.There are 2 example ones that works (non-Hidden) and one that
doesnt (Hidden). I don't need both to work only the hidden one to
start working.
Thanks in advanced.
<head>
<script>
function copyToClipboard(field)
{
var content = eval("document."+field)
content.focus()
content.select()
range = content.createTextRange()
range.execCommand("Copy")
window.status="Contents copied to clipboard"
setTimeout("window.status=''",1800)
}
</script>
</head>
<body>
<form name=myform1>
<input type=hidden name=mytext1 value='This Hidden Field Wont Copy'></
form>
<a href="#" onclick="javascript:copyToClipboard('myform1.mytext1')"
value="Send to Clipboard">1<a/>
<form name=myform2>
<input type=text name=mytext2 value='This non hidden field will
copy.'>
<a href="#" onclick="javascript:copyToClipboard('myform2.mytext2')"
value="Send to Clipboard">2<a/>
</form>
</body>
this. I want to click to copy a Hidden Field. I have the following
script but when hidding the field it says it wont work. Any
Ideas.There are 2 example ones that works (non-Hidden) and one that
doesnt (Hidden). I don't need both to work only the hidden one to
start working.
Thanks in advanced.
<head>
<script>
function copyToClipboard(field)
{
var content = eval("document."+field)
content.focus()
content.select()
range = content.createTextRange()
range.execCommand("Copy")
window.status="Contents copied to clipboard"
setTimeout("window.status=''",1800)
}
</script>
</head>
<body>
<form name=myform1>
<input type=hidden name=mytext1 value='This Hidden Field Wont Copy'></
form>
<a href="#" onclick="javascript:copyToClipboard('myform1.mytext1')"
value="Send to Clipboard">1<a/>
<form name=myform2>
<input type=text name=mytext2 value='This non hidden field will
copy.'>
<a href="#" onclick="javascript:copyToClipboard('myform2.mytext2')"
value="Send to Clipboard">2<a/>
</form>
</body>