Count Checked Checkboxes - InfoPath Dev
in

InfoPath Dev

Count Checked Checkboxes

Last post 06-22-2005 09:34 AM by Agni Jonnalagadda. 5 replies.
Page 1 of 1 (6 items)
Sort Posts: Previous Next
  • 06-15-2005 08:05 AM

    Count Checked Checkboxes

    I have a form that is used for Health Department Inspections. The inspections check checkboxes for items missed. These checkboxes are radio buttons that I converted to checkboxes so that they could select full deductions or 1/2 deductions. Some of the items are critical items. Being a newbie to InfoPath, I cannot figure out how to update a field to count the number of critical items missed.

    Thanks in advance,
    Jason Snipes
  • 06-15-2005 12:06 PM In reply to

    Re: Count Checked Checkboxes

    Hi Jason,
    Welcome to our forum! I need a little more information about your scenario. Are you trying to count the number of checkboxes checked? Do you have a field in your data source for the count? You can add an OnAfterChange event handler to the root node (parent of your checkboxes) and add logic in it to update your count. You'll probably want to iterate over your checkboxes and just recount them since it should be pretty fast. Hope that helps, but please provide more info if not.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 06-16-2005 04:15 AM In reply to

    Re: Count Checked Checkboxes

    I have a field in my datasourse for the count. It is called CriticalItemCount. There are 34 sets of checkboxes. I only need to know the count of 10 of them. Only 10 of the radiobutton sets are critical items. I am still really new at this so when you mention iterating over the checkboxes I am clueless how to do that. If there is a way to provide you the form just let me know.

    Jason Snipes
  • 06-21-2005 07:23 PM In reply to

    Re: Count Checked Checkboxes

    Hi Jason,
    Sorry for the delay. "Iterating over the checkboxes" implies writing code. There may be a way to do it using an xpath, but code may actually be simpler (and easier to debug). Unfortunately, we don't have time to write code snippets for everyone these days but if you want to retain us for a small fee, let me know.

    Patrick Halstead [InfoPath MVP]
    InfoPathDev
    Patrick Halstead
    Project Manager at Qdabra
  • 06-22-2005 05:22 AM In reply to

    Re: Count Checked Checkboxes

    Ok, Writing code sounds good. What event would I be looking for to trigger the count? Maybe I should just do the count when they attempt to save the document.

    Jason
  • 06-22-2005 09:34 AM In reply to

    Re: Count Checked Checkboxes

    You can use onAfterChangeMethod on the checkbox, this gets fired once you select the checkbox. You can calculate your count here in this method.
    Or as you said you can write it on submit.

    Agni
    InfoPathDev India
Page 1 of 1 (6 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.