Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-08-2012, 01:41 AM   PM User | #1
davidp994
New to the CF scene

 
Join Date: Nov 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
davidp994 is an unknown quantity at this point
Selecting all of the checkboxes jQuery

I have code which displayed a person's info in a table(fields:name, surname, address, etc.) and one of the inputs is a checkbox. The code is as follows:
Code:
$("#table").append('<tr class="trow'+j+'">'+
'<td class="ids" id="z'+i+'">'+totrecs+'</td>'+
'<td>'+member[i].jdate+'</td>'+
'<td class="users"
'<td id="contact'+i+'">'+member[i].fname+'

'+member[i].lname+'</td>'+

'<td id="myaddress'+i+'">'+member[i].address1+'

'+member[i].town+'</td>'+

'<td><input type="checkbox" name="whome" id="showMe'+i+'"'+
'class="boxes" onclick="getMe('+i+')" /></td></tr>');
totrecs++;
j++;
}
and the button -

Code:
<input type="button" id="selectall" title="Select All" value="Select All" />
What I am tryin to do is program a function that when clicking a certain button all of the checkboxes will be selected/checked.

I would appreciate any help. Thank You.
davidp994 is offline   Reply With Quote
Old 11-08-2012, 08:24 AM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,261
Thanks: 10
Thanked 533 Times in 527 Posts
devnull69 will become famous soon enough
Code:
$('#selectall').click(function() {
   $('input:checkbox').prop('checked', true);
});
devnull69 is offline   Reply With Quote
Reply

Bookmarks

Tags
jquery javascript ajax

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:10 AM.


Advertisement
Log in to turn off these ads.