• 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
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

checkbox question

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,
i'm trying to create a checkbox dialog similar to yahoo email with the 'select or deselect all' box. how do i make this button to be automatically selected if i select all the items below? for example, if i select this 'select all' box, all the items below are selected. but if it is unchecked and i select all the boxes below the 'select all' box is not checked. i hope i made myself clear. i'm fairly new with this so hopefully someone can answer this question for me. here's a sample code that i have:
.
<form name=myform>
<input type="checkbox" name=mybox value="1">all
<input type="checkbox" name=mybox value="1" checked>one
<input type="checkbox" name=mybox value="2" >two
<input type="checkbox" name=mybox value="3" checked>three
</form>
.
in the above example, i want the 'all' box to be checked if i select 'one' 'two' and 'three' checkbox.
 
Sheriff
Posts: 67650
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
Set up an event handler for the checkboxes, and whenever one changes, check to see of they are all checked or not. Set the state of the "master checkbox" accordingly.
 
reply
    Bookmark Topic Watch Topic
  • New Topic