Loading...
Copy code
Close
Permalink
Close
Please tell us why you want to mark the subject as inappropriate.
(Maximum 200 characters)
Report Inappropriate
Cancel
Private Message
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Cancel
From :
guest
To :
Subject :
Content :
Type the characters you see in the picture below.
Send
Update
Cancel
Feedback
Email ID
Subject :
Comments :
Send
Cancel
Private Message
Type the characters you see in the picture below.
Type the characters you see in the picture below.
Attach files
Desktop
Google Docs
Each Attachment size should not exceed 1.0 MB.
Max no of attachments : 3
Loading User Profile...
guest
Response title
This is preview!
Attachments
Publish
Back to edit
Cancel
(
)
Sign In
New to this Portal? Click here to
Sign up
You can also use the below options to login
Login with Facebook
Login with Google
Login with Yahoo
jQuery
Plugins
UI
Meetups
Forum
Blog
About
Donate
All Forums
Recent Posts
Log In
Search
jQuery
Search
jQuery Forum
Screen name:
alski1000
alski1000's Profile
1
Posts
1
Responses
0
Followers
Activity Trend
Last 30 days
Last 30 days
Date Interval
From Date :
To Date :
Go
Loading Chart...
Posts
Responses
PM
Show:
All
Discussions
Questions
Ideas
Problems
Expanded view
List view
Private Message
Toggle checkboxes and uneditable checkboxes
[2Replies]
23-Jun-2010 11:28 PM
Forum:
Using jQuery
I have a series of checkboxes and a button. When I click the button, I'd like all of the checkboxes to either all turn on, or all turn off (a toggle).
In regular javascript I can do this:
var checkflag = "false";
function check(field) {
if (checkflag == "false") {
for (i = 0; i < field.length; i++) {
field[i].checked = true;
}
checkflag = "true";
return "Uncheck All";
} else {
for (i = 0; i < field.length; i++) {
field[i].checked = false;
}
checkflag = "false";
return "Check All";
}
}
<input type=checkbox name=list value="1">Value1<br>
<input type=checkbox name=list value="2">Value2<br>
<input type=checkbox name=list value="3">Value3<br>
<input type=checkbox name=list value="4">Value4<br>
<input type=checkbox name=list value="5">Value5<br>
<br>
<input type=button value="Check All" onClick="this.value=check(this.form.list)">
I'd love a jQuery version of the above.
However, I don't want the user to be able to check or uncheck the checkboxes individually. How do I make those checkboxes uneditable?
I think this is similar to mouseEnabled = false in ActionScript. Is there an equivalent in javascript (preferably jQuery)?
«Prev
Next »
Moderate user : alski1000
Forum