Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 stop copy paest

Author  Topic 

chiragvm
Yak Posting Veteran

65 Posts

Posted - 2006-11-02 : 10:06:40
hi to all

i want to stop peast in my webpage's textbox
<script type="text/javascript" >

var sSave = "";
function fnBeforeCut() {
event.returnValue = false;
}

function fnCut(id) {
event.returnValue = false;
sSave = id.innerText;
id.innerText = "";
}

function fnBeforePaste() {
event.returnValue = false;
}

function fnPaste(id) {
event.returnValue = false;
id.innerText = sSave;
}

</script>


use this script in html textbox

when asp:textbox
txtcpassword.Attributes.Add("onSelectStart", "return false;")
txtcpassword.Attributes.Add("onPaste", "return false;")
use this code

it working fine in intenetexplorer(microsoft)
but not work in firefox
please give me a solution it's urgent

robvolk
Most Valuable Yak

15732 Posts

Posted - 2006-11-02 : 10:13:00
Maybe posting your question on a JavaScript site would be better, SQL Team is primarily a SQL Server site. I know that IE's JavaScript model is different from the standard.
Go to Top of Page
   

- Advertisement -