SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 Script Library
 preavent copy paste
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

chiragvm
Yak Posting Veteran

India
63 Posts

Posted - 11/02/2006 :  10:22:47  Show Profile  Reply with Quote
hi to all

i want to stop paste 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

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 11/02/2006 :  10:56:51  Show Profile  Visit spirit1's Homepage  Reply with Quote
1. this is a forum for working scripts.
2. you haven't provided the way you're using your functions.
3. download aptana: http://weblogs.sqlteam.com/mladenp/archive/2006/07/31/10914.aspx
4. use it to develop the javascript there because it shows you which functions will work in IE, FF, Opera, etc
5. google returns nothing?



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

jsmith8858
Dr. Cross Join

USA
7423 Posts

Posted - 11/02/2006 :  11:03:16  Show Profile  Visit jsmith8858's Homepage  Reply with Quote
Disabling cutting and pasting on a web page sounds like you are inventing a problem to find a solution for.

In addition, a user can always disable javascript, don't forget, or use other tricks to circumvent such "features" on your pages. Any time you try to implement any sort of security at the client you are vulnerable to hacks.

Can I ask why you are doing this?

- Jeff
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 11/02/2006 :  11:08:28  Show Profile  Visit spirit1's Homepage  Reply with Quote
isn't it obvious, jeff? to prevet users from pasting things



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page

spirit1
Cybernetic Yak Master

Slovenia
11750 Posts

Posted - 11/02/2006 :  11:09:53  Show Profile  Visit spirit1's Homepage  Reply with Quote
plus it a cross post:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=74388



Go with the flow & have fun! Else fight the flow
blog thingie: http://weblogs.sqlteam.com/mladenp
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000