• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Function to select all

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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]
 
Sheriff
Posts: 67752
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Or you could save yourself some gray hair and do it with jQuery. The code to check all checkboxes:
 
That new kid is a freak. Show him this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic