Multiple Select Checkboxes

Results 1 to 2 of 2

Thread: Multiple Select Checkboxes

  1. #1
    Join Date
    Dec 1969

    Default Multiple Select Checkboxes

    I am trying to figure out how to check all the checkboxes that are categoriesed. Here&#039;s an eg: This is the query <BR>SELECT SkillCategory.ID, SkillCategory.Description, Skills.SkillID, Skills.SkillDesc <BR>FROM SkillCategory, Skills, OfficeSkills<BR>WHERE Skills.SkillCategoryID (+) = SkillCategory.ID <BR>AND Skills.SkillID = OfficeSkills.SkillID (+)<BR><BR>and here&#039;s the result<BR>8 Database 627 Arbor<BR>8 Database 628 Architecture<BR>8 Database 629 Data Modeling<BR>8 Database 630 Data Warehousing<BR>8 Database 631 Datamart<BR>8 Database 632 DB/400<BR>9 Development Tools 666 Actuate<BR>9 Development Tools 667 Adobe Acrobat<BR>9 Development Tools 668 Adobe FrameMaker<BR><BR>Now on my page, I list all skilldesc under these categories<BR><BR>Database - Check all Uncheck all<BR> Arbor <BR> Architecture<BR> Data Modeling<BR> Data Warehousing<BR> Datamart<BR> DB/400<BR>Development Tools - Check All Uncheck All<BR> ALLEGRO<BR> ATL<BR> AUTOCAD <BR><BR>How should I base my Javascript function, so that when I click on "check all" next to database, checkboxes with skills under that are all checked. If I click on Development Tools "check all", All the skills under that category are checked. Now what I have checks everything.<BR><BR> function CheckAll() {<BR> len = document.update.chkID.length;<BR> var i=0;<BR> for( i=0; i&#060;len; i++) {<BR> document.update.chkID[i].checked=true;<BR><BR> }<BR> }<BR>I could hardcode all the category, but there is a possibility to new category being added. In that case, hardcoding will not work. Any suggestions.<BR><BR>Thanks

  2. #2
    jamar Guest

    Default RE: Multiple Select Checkboxes

    There are lots of ways to do this, so assuming your asp code is in vbscript here is one suggestion:<BR>1. For each record combine each skill with it&#039;s catID using somthing arbitrary as a delimiter and each set delimited by a comma such as:<BR>Blah##ID,AS400##8,Modeler##8,ETC##AnotherID <BR>2. pass that vbscript string into your client-side js "check" function<BR>3. split each key/value pair into a two diminsional array keyed by CatID, and the second diminsion being the description. <BR>4. use a for each loop to check everything that applies when the use selects "check all"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts