ASP.NET jQuery 實(shí)例3 (在TextBox里面阻止復(fù)制、剪切和粘貼事件)
我們先來(lái)看下實(shí)現(xiàn)后的效果:
輸入新密碼
<body>
<form id="form1" runat="server">
<div align="center">
<fieldset style="width: 400px; height: 180px">
<table cellpadding="3" cellspacing="3" border="0">
<tr>
<td colspan="2" class="header">
修改密碼
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblCurrentPwd" Text="當(dāng)前密碼: " runat="server"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtCurrentPwd" Width="200px" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblNewPwd" Text="新密碼: " runat="server"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtNewPwd" Width="200px" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
<asp:Label ID="lblConfirmNewPwd" Text="確認(rèn)新密碼: " runat="server"></asp:Label>
</td>
<td>
<asp:TextBox ID="txtConfirmNewPwd" Width="200px" runat="server" TextMode="Password"></asp:TextBox>
</td>
</tr>
<tr>
<td>
</td>
<td>
<asp:Button ID="btnSubmit" runat="server" Text="提交" /> <asp:Button ID="btnReset" runat="server"
Text="重置" />
</td>
</tr>
</table>
</fieldset>
</div>
</form>
</body>
腳本代碼
<head runat="server">
<title>Recipe3</title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<style type="text/css">
.header
{
background-color:Gray;
font-weight:bold;
font-size:large;
}
</style>
<script type="text/javascript">
$(document).ready(function () {
$("input:password").bind("copy cut paste", function (e) { // 通過(guò)空格連續(xù)添加復(fù)制、剪切、粘貼事件
e.preventDefault(); // 阻止事件的默認(rèn)行為
alert("復(fù)制/剪切/粘貼已經(jīng)在文本框中禁止掉了");
});
});
</script>
</head>
相關(guān)文章
使用jquery實(shí)現(xiàn)IE下按backspace相當(dāng)于返回操作
后退鍵在各瀏覽器下默認(rèn)為點(diǎn)擊了一下后退按鈕,下面為大家介紹下如何實(shí)現(xiàn)實(shí)現(xiàn)IE下按backspace相當(dāng)于返回操作,需要的朋友可以參考下2014-03-03jQuery-onload讓第一次頁(yè)面加載時(shí)圖片是淡入方式顯示
第一次打開(kāi)一個(gè)頁(yè)面時(shí),讓加載好的圖片先隱藏,然后再執(zhí)行動(dòng)畫(huà)fadeIn,這里的load事件:當(dāng)所有子元素已經(jīng)被完全加載完成時(shí),load事件被發(fā)送到這個(gè)元素2012-05-05jQuery ajax serialize() 方法使用示例
serialize() 方法創(chuàng)建以標(biāo)準(zhǔn) URL 編碼表示的文本字符串,下面為大家介紹下jQuery serialize方法的使用2014-11-11jQuery實(shí)現(xiàn)鼠標(biāo)跟隨提示層效果代碼(可顯示文本,Div,Table,Html等)
這篇文章主要介紹了jQuery實(shí)現(xiàn)鼠標(biāo)跟隨提示層效果代碼,具備顯示文本,Div,Table,Html等功能.涉及jQuery針對(duì)鼠標(biāo)事件及頁(yè)面元素的相關(guān)操作技巧,需要的朋友可以參考下2016-04-04jQuery動(dòng)態(tài)添加元素后元素注冊(cè)事件失效解決
這篇文章主要介紹了jQuery動(dòng)態(tài)添加元素后元素注冊(cè)事件失效解決,文章圍繞主題展開(kāi)詳細(xì)的內(nèi)容介紹,具有一定的參考價(jià)值,需要的小伙伴可以參考一下2022-08-08JQuery實(shí)現(xiàn)倒計(jì)時(shí)按鈕具體方法
頁(yè)面中需要實(shí)現(xiàn)某個(gè)按鈕點(diǎn)擊完后,禁用它,并顯示倒計(jì)時(shí)。這個(gè)默認(rèn)是3秒,代碼如下2013-11-11Jquery中的offset()和position()深入剖析
jquery 中有兩個(gè)獲取元素位置的方法offset()和position(),這兩個(gè)方法之間有什么異同?使用的時(shí)候應(yīng)該注意哪些問(wèn)題?什么時(shí)候使用offset(),什么時(shí)候又使用position()呢?2009-05-05jQuery實(shí)現(xiàn)倒計(jì)時(shí)(倒計(jì)時(shí)年月日可自己輸入)
本篇文章主要對(duì)jQuery實(shí)現(xiàn)倒計(jì)時(shí)進(jìn)行了實(shí)例分析。并附上實(shí)例源碼,有興趣的朋友可以下載源碼調(diào)試運(yùn)行試試看,希望對(duì)大家有所幫助2016-12-12jQuery實(shí)現(xiàn)的簡(jiǎn)單分頁(yè)示例
這篇文章主要介紹了jQuery實(shí)現(xiàn)的簡(jiǎn)單分頁(yè),涉及jQuery數(shù)學(xué)運(yùn)算與頁(yè)面元素操作技巧,具有一定參考借鑒價(jià)值,需要的朋友可以參考下2016-06-06