This looks like it's going to cause a problem. What happens if someone
clicks #check1 but then changes her mind? She can't click #check2
anymore, because it's disabled.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Oct 10, 2009, at 11:50 AM, Tan wrote:
Hello, all
I have a code:
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'
'http://www.w3.org/TR/html4/loose.dtd'>
<html>
<head>
<script src='http://code.jquery.com/jquery-latest.js'></script>
<script>
$(document).ready(function(){
$('input [name="check1"] :checked').click(function(){
$('input [name="check12"]').attr('disable','disable');
});
});
</script>
<style>
body { cursor:pointer; }
div { width:50px; height:30px; margin:5px; float:left;
background:green; }
span { color:red; }
</style>
</head>
<body>
<form id="ajj" action="" method="post">
<input type="checkbox" name="check1" id="check1">Title
<input type="checkbox" name="check2" id="check2">Body
<input type="submit" name="submit" value ="Save it">
</form>
</body>
</html>
I want when i choosen check1(title) then check2(body) disable. and
else if i choosen check2 then check1 disable
I write a code:
$(document).ready(function(){
$('input [name="check1"] :checked').click(function(){
$('input [name="check12"]').attr('disable','disable');
});
});
but it's not work.
Please help me.