File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Function to select all

 
Pat Peg
Ranch Hand
Posts: 195
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have this function

It is suppose to �check all� check boxes when the link is selected but it isn�t working in IE (or FF but IE is what I am trying for). I tried using FF error console but I don�t get any errors�I know the name of the checkboxes are all the same but that is needed for other functionality.
Any ideas on what could be the cause?

Thanks
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do not check for the value of on/off, look at the check state of the checkbox.

Eric
 
Pat Peg
Ranch Hand
Posts: 195
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK-I tried that it makes the code cleaner but it still fails to function...
[code]

function CheckAll() {

var i;
//Check all or Uncheck all awards...
for ( i in ListRecordForm.p_search_award_type ) {
if ( ListRecordForm.p_search_award_type[i].checked ) //turn them off
ListRecordForm.p_search_award_type[i].checked = false;
else //turn them off
ListRecordForm.p_search_award_type[i].checked = true;
}



}
[code]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could save yourself some gray hair and do it with jQuery. The code to check all checkboxes:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic