////////////// Exp
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript"
src="http://code.jquery.com/jquery-1.7.2.min.js"></script>
<script language="javascript">
$(document).ready(function () {
$("#btnDisable").on("click", function
() {
$("#divContainer").find("input, button, submit, textarea, select").attr("disabled", "disabled");
$("#divContainer").find("a").click(function
(e) {
e.preventDefault();
});
});
$("#btnEnable").on("click", function
() {
$("#divContainer").find("input, button, submit, textarea, select").removeAttr("disabled");
$("#divContainer").find("a").unbind("click");
});
});
</script>
</head>
<body>
<input type="button"
id="btnDisable"
value="Disable
Controls" />
<input type="button"
id="btnEnable"
value="Enable
Controls" />
<div id="divContainer"
style="broder: solid 1px #ccc; padding: 10px;">
UserName<br
/>
<input type="text" id="txtUserName"
/>
<br />
Password<br
/>
<input type="password"
id="txtPassword"
/>
<br />
<input type="checkbox"
id="chbRember"
/>Rember me
<br />
<input type="button"
id="btnLogin"
value="Login"
/>
<br />
<br />
<a href="/home.aspx"
target="_blank">Home
Page</a>
</div>
</body>
</html>
No comments:
Post a Comment