I have 60+ checkboxes all with unique names, how can I get a count of how many are checked?

The checkboxes are named 1a, 1b, 1c, 2a, 2b, 2c, etc.. up to 27a, 27b... I could add the word "bed" to the beginning of each name if it helps.
I want to create a text field that will update the count every time a box is checked or unchecked.
Thanks

It would be better to add "bed." instead, so that the field names are "bed.1a", "bed.1b", ..."bed.27b". You can then easily get an array of all of the "bed" fields, check each one, and increment a counter. The custom calculate script for the text field could be something like:
// Custom calculate script
(function () {
    // Get an array of the bed fields
    var fa = getField("bed").getArray();
    // Initialize counter
    var sum = 0;
    // Loop through the fields and update counter
    for (var i = 0; i < fa.length; i += 1) {
        sum += fa[i].value !== "Off" ? 1 : 0;
    // Set this field's value to the sum
    event.value = sum;

Similar Messages

  • I just backed my iPhone up and now I have lost all of my recent info. How can I get it back to how it used to be

    I just backed my iPhone up and now I have lost all of my recent info. How can I get it back to how it used to be

    Did you fail to import your photos before updating?  If so, then they are likely gone.  You can try restoring from backup.  If that fails then they are gone.  You should regularly import photos to your computer, most especially before any update.
    Did you fail to transfer any purchases on iphone ( that were not on your computer) to your computer before updating?  If so, then you will have to redownload:
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • My iPhone4 back scrren is cracked. I have purchasded it from US and using it in India after factory unlock. How can I get it done and how much it would cost me.

    My IPhone4 back screen is damaged. I have puchsed it from US and using in India after factory restore.
    How can I get it repaired and how much it would cost me for original part to to be replaced.

    To have Apple repair the phone, you would need to send it to someone you know in the US to have him or her bring it to Apple for repair.  The iPhone warranty is NOT international.  In addition, Apple doesn't sell parts.

  • I recently changed my e-mail hosting service, and all my mail in my iPhone just disappered, How can I get it back? How can I prevent from it happening again?

    As soon as I changed de Pop settings in t, all my mail disappered in a matter of minutes, Why? How can I get it back? I did full backup a couple of weeks ago, can I recover it from there?

    Hey jartansmom,
    Thanks for the question. You may need to configure the outgoing mail server for the account. The following resource will outline how to navigate to these settings, however instead of adding a server, you’ll then want to update the settings with your correct username and password:
    iOS: Configuring additional outgoing mail servers
    http://support.apple.com/kb/HT4519
    1. Tap Settings > Mail, Contacts, Calendars.
    2. Tap the Mail account for which you would like to change the settings. If you configured your account using any of the built-in presets, IMAP, or Exchange, you may need to tap Account Info on the following screen.
    3. On the Account Info screen, locate the Outgoing Mail Server section and tap the existing SMTP entry. A list of SMTP servers will appear with the Primary Server and Other SMTP Servers.
    If you need help with your mail settings, you can utilize this tool:
    Mail Settings Lookup - Apple Support
    https://ssl.apple.com/support/mail-settings-lookup/
    Thanks,
    Matt M.

  • How can i get a counter to tell me how many checkboxes have been selected?

    package arabiclanguagelearning;
    import java.awt.BorderLayout;
    import java.awt.Frame;
    import javax.swing.JDialog;
    import javax.swing.JPanel;
    import java.awt.Rectangle;
    import javax.swing.JTextArea;
    import com.borland.jbcl.layout.VerticalFlowLayout;
    import javax.swing.JLabel;
    import javax.swing.*;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.Toolkit;
    import java.awt.Image;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.CheckboxGroup;
    import java.awt.event.ItemListener;
    import java.awt.event.ItemEvent;
    import java.awt.event.KeyEvent;
    * <p>Title: Arabic Language Learning</p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2007</p>
    * <p>Company: </p>
    * @author iPortal
    * @version 1.0
    public class ReadingTest extends JDialog implements ItemListener{
        //ImageIcon myImage = new ImageIcon("image.jpg");
        JPanel panel1 = new JPanel();
        JLabel jLabel1 = new JLabel();
        JLabel jLabel3 = new JLabel();
        JButton jButton1 = new JButton(new ImageIcon ("image.jpg"));
        ButtonGroup question1 = new ButtonGroup();
        CheckboxGroup question2 = new CheckboxGroup();
        JTextArea question1Text = new JTextArea();
        JRadioButton q1A = new JRadioButton();
        JRadioButton q1B = new JRadioButton();
        JRadioButton q1C = new JRadioButton();
        JTextArea question2Text = new JTextArea();
        JTextField question2TextArabic = new JTextField();
        JCheckBox jCheckBox1 = new JCheckBox();
        JCheckBox jCheckBox2 = new JCheckBox();
        JCheckBox jCheckBox3 = new JCheckBox();
        JCheckBox jCheckBox4 = new JCheckBox();
        JLabel jLabel2 = new JLabel();
        StringBuffer choices;
        //will keep a count on how many checkboxes selected for question 2
        int count;
        JLabel jLabel4 = new JLabel();
        JLabel jLabel5 = new JLabel();
        JLabel jLabel6 = new JLabel();
        JButton Submit = new JButton();
        JLabel jLabel7 = new JLabel();
        public ReadingTest(Frame owner, String title, boolean modal) {
            super(owner, title, modal);
            try {
                setDefaultCloseOperation(DISPOSE_ON_CLOSE);
                jbInit();
                pack();
            } catch (Exception exception) {
                exception.printStackTrace();
        public ReadingTest() {
            this(new Frame(), "ReadingTest", false);
        private void jbInit() throws Exception {
            panel1.setLayout(null);
            this.getContentPane().setLayout(null);
            jLabel1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 24));
            jLabel1.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel1.setIcon(null);
            jLabel1.setText("Welcome to the reading tutorial");
            jLabel1.setBounds(new Rectangle(49, 4, 509, 67));
            jLabel3.setFont(new java.awt.Font("Tahoma", Font.PLAIN, 14));
            jLabel3.setToolTipText("");
            jLabel3.setHorizontalAlignment(SwingConstants.CENTER);
            jLabel3.setHorizontalTextPosition(SwingConstants.CENTER);
            jLabel3.setText(
                    "Please answer the questions below after reading the text");
            jLabel3.setVerticalTextPosition(SwingConstants.TOP);
            jLabel3.setBounds(new Rectangle(48, 83, 515, 60));
            jButton1.setBounds(new Rectangle(509, 63, 98, 44));
            jButton1.setText("Hide me!");
            jButton1.addActionListener(new ReadingTest_jButton1_actionAdapter(this));
            question1Text.setBackground(Color.lightGray);
            question1Text.setFont(new java.awt.Font("Tahoma", Font.BOLD, 14));
            question1Text.setEditable(false);
            question1Text.setText("What is the first letter of the arabic alphabet?");
            question1Text.setBounds(new Rectangle(64, 158, 319, 19));
            q1A.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1A.setText("?");
            q1A.setBounds(new Rectangle(60, 189, 93, 23));
            q1B.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1B.setText("?");
            q1B.setBounds(new Rectangle(60, 214, 93, 23));
            q1C.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            q1C.setText("?");
            q1C.setBounds(new Rectangle(60, 241, 93, 23));
            question2Text.setBackground(Color.lightGray);
            question2Text.setFont(new java.awt.Font("Tahoma", Font.BOLD, 14));
            question2Text.setEditable(false);
            question2Text.setText(
                    "Choose the two correct words which finish the sentence.");
            question2Text.setBounds(new Rectangle(64, 281, 402, 19));
            question2TextArabic.setFont(new java.awt.Font("Tahoma", Font.BOLD, 16));
            question2TextArabic.setText("?? ????? ??????? ___ ???? ___ ?? ???????");
            question2TextArabic.setBounds(new Rectangle(63, 311, 404, 30));
            this.setForeground(Color.white);
            jCheckBox1.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox1.setText("????");
            jCheckBox1.setBounds(new Rectangle(63, 356, 81, 23));
            jCheckBox1.addActionListener(new ReadingTest_jCheckBox1_actionAdapter(this));
            jCheckBox1.addItemListener(this);
            jCheckBox2.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox2.setText("????");
            jCheckBox2.setBounds(new Rectangle(162, 356, 81, 23));
            jCheckBox2.addItemListener(this);
            jCheckBox3.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox3.setText("??????");
            jCheckBox3.setBounds(new Rectangle(260, 356, 81, 23));
            jCheckBox3.addItemListener(this);
            jCheckBox4.setFont(new java.awt.Font("Tahoma", Font.BOLD, 13));
            jCheckBox4.setText("?????");
            jCheckBox4.setBounds(new Rectangle(359, 355, 81, 23));
            jCheckBox4.addItemListener(this);
            jLabel2.setText("jLabel2");
            jLabel2.setBounds(new Rectangle(63, 402, 234, 32));
            jLabel4.setText("jLabel4");
            jLabel4.setBounds(new Rectangle(63, 433, 254, 28));
            jLabel5.setText("jLabel5");
            jLabel5.setBounds(new Rectangle(63, 465, 194, 37));
            jLabel6.setText("jLabel6");
            jLabel6.setBounds(new Rectangle(63, 500, 258, 32));
            Submit.setBounds(new Rectangle(507, 575, 115, 52));
            Submit.setText("Submit");
            Submit.addActionListener(new ReadingTest_Submit_actionAdapter(this));
            jLabel7.setText("jLabel7");
            jLabel7.setBounds(new Rectangle(472, 480, 95, 34));
            question1.add(q1A);
            question1.add(q1B);
            question1.add(q1C);
            this.getContentPane().add(panel1, null);
            this.getContentPane().add(Submit);
            panel1.add(jLabel1);
            panel1.add(jLabel3);
            panel1.add(q1A);
            panel1.add(q1B);
            panel1.add(q1C);
            panel1.add(question1Text);
            panel1.add(question2Text);
            panel1.add(question2TextArabic);
            panel1.add(jCheckBox1);
            panel1.add(jCheckBox2);
            panel1.add(jCheckBox3);
            panel1.add(jCheckBox4);
            panel1.add(jButton1);
            panel1.add(jLabel6);
            panel1.add(jLabel5);
            panel1.add(jLabel4);
            panel1.add(jLabel2);
            panel1.add(jLabel7);
            panel1.setBounds(new Rectangle(10, 10, 623, 549));
        public void jButton1_actionPerformed(ActionEvent e) {
            this.setVisible(false);
        public void itemStateChanged(ItemEvent e) {
            int index = 0;
            char c = '-';
            Object source = e.getItemSelectable();
    //count variable works fine in this part
            if (source == jCheckBox1) {
                index = 0;
                c = 'c';
                //assign new string variable the value of text for the checkbox
                String textSelected = jCheckBox1.getText();
                jLabel2.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox2) {
                index = 1;
                c = 'g';
                String textSelected = jCheckBox2.getText();
                jLabel4.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox3) {
                index = 2;
                c = 'h';
                String textSelected = jCheckBox3.getText();
                jLabel5.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            } else if (source == jCheckBox4) {
                index = 3;
                c = 't';
                String textSelected = jCheckBox4.getText();
                jLabel6.setText("You checked"+ textSelected);
                count = count + 1;
                jLabel7.setText(Integer.toString(count));
            //Now that we know which button was pushed, find out
             //whether it was selected or deselected.
    //count variable does not work in this section.
             if (e.getStateChange() == ItemEvent.DESELECTED) {
                 c = '-';
                 Object deselectedItem = e.getItemSelectable();
                 if (deselectedItem==jCheckBox1)
                     jLabel2.setText("You deselected checkbox 1");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox2)
                     jLabel4.setText("You deselected checkbox 2");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox3)
                     jLabel5.setText("You deselected checkbox 3");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
                 else if (deselectedItem==jCheckBox4)
                     jLabel6.setText("You deselected checkbox 4");
                     count = count - 1;
                     jLabel7.setText(Integer.toString(count));
       

    you can call your_checkbox.isSelected() to know whether it's selected for all your check boxes !
    suppose you have an jcheckbox array : JCheckBox[] myCheckBoxArray = ...;
    int counter = 0;
    for(int i=0; i<myCheckBoxArray.legth; i++){
      if(myCheckBoxArray.isSelected())
      counter++;
    }and that's all

  • I have a 7510 all in one fax and can't get it on line. Can you help?

    I can't get my 7510 on line to enable fax. I tried logging ing with the fax number and pin but can't get it to work.

    Hey Mhlogging,
    Thank you for your question! I understand you're having a hard time setting up your fax. If eFax is having a hard time verifying your PIN and eFax number, try logging into into your eFax account (www.efax.com) and review your account information. It's possible that the account information is not verified on the printer. 
    If you continue to have problems, please let me know. Otherwise, feel free to mark the solution as solved.
    Thanks!
    I am an HP employee.

  • How can I get a count of ALL nodes in a JTree?

    Not sure if I am missing something here or what. Is there an easy way to determine the total number of nodes in a JTree? I thought there would be a method to return this, but I'm not seeing it in JTree or DefaultTreeModel. Do I have to start at the root and recursively get child counts? Yuck!
    Jamie

    You are absolutely right! Create a recursive method and count all your children from the root.
    Denis Krukovsky
    http://dotuseful.sourceforge.net/

  • Hi all. I have a factory unlocked iphone 4s. I'm from Belize but i'm going to visit Fort Lauderdale, FLA. How can I get data for my phone? I checked the web and only got 'not sure to don't know' answers. Whoever has done this please help me

    Hi All. I live outside of the USA and have an iPhone 4s. I'm going to Fort Lauderdale, FLA and want to data service for my iPhone ( navigation using google or imaps, browsing and voip ing when no wi fi available). I browsed the net but seems almost impossible. When I visited Toronto I was able to get data thru Koodo but I don't think this is offered in the USA. Anyone who has real experience with this please help. This is a situation that is best aided by persons who have experienced it. Thanks

    Have a look here:
    http://forums.macrumors.com/archive/index.php/t-982315.html

  • I put all my music from my iphone on my computer and now i only have the new music i just bought and it wont sync and i have to restore my phone and all my new music i will have to repurchase all my new music i can i get it to sync without it happening

    my phone wont sync and it wont put music on my pohone and the new music i just bought will be deleted if i restore my ohine and i will have to re buy all the music i have recently bought

    You will need to do it using a third-party utility such as Phone to PC. Also, see:
    How to dowload purchased music
    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • I have trouble getting my new Apple TV 2 to work to the internet. I have an Imac with OsX 10.6.8 using a 3G modem to connect to the internet. I have a Time Capsule with Airport. I can't get the Apple TV to see my internet connection

    I have an Imac with OSX 10.6.8 dual intel core.
    Apple TV 2
    Timecapsule
    3G modem connected to iMac for internet access.
    I have tied to get Apple TV2 to see the inernet but it does not seem to see the inernet connection either via the Airport network or even if I connect it directly with a ethernet cable to the Timecapsule or the iMac.
    I have tired to set up Home Sharing but it doen't see the Itunes Store so no go.
    I don't have wired internet but it is probably something to do with using a 3G modem
    Any tips on how I can check if the TV coonect to internet and what to do about this problem?
    I was trying to connect my HD TV earlier using a WiFi USB modem but it could not see my iMac. Apple Support told me to buy an Apple TV but that is not helping as I can't see anything there either.
    Regards from Michael

    Thank you so much Paul_31 for your suggestions, HUGELY appreciate the effort
    I have reset the printing system, a few times for good measure but nadda.
    I have also looked at getting the software from the Apple site after seeing that with Snow Leopard you should let the operating system lead the install not the manufacteurers software as it is most likely out of date.  I too found it wasn't there so I uninstalled the software got up the CLX_3300 series stuff then went from there with the USB cable.  It apparently hasn't worked either
    Unfortunately now after using the print utility to scan for a while that has now gone again on the last restart of the Mac.  I am so completely clueless
    The box says the printer is compatible, the place of purchase said it was compatible, the Samsung site says it is compatible.
    I think it's the set up of my Mac? Our maybe a glitch in the network settings?
    Thanks again

  • Has anyone set up a Solaris 7 LDAP client to use with iPlanet DS 5.0?  I have only found docs for compiling OpenLDAP and have had NO LUCK with it. I can't get an LDAP client to run.

    I am trying Not to have 3 separate versions of LDAP in my environment (iDS5,Native Solaris LDAP,OpenLDAP). Can anyone point me to some DETAILED instructions to get an LDAP client (not server) running on Solaris 7?

    Hi,
    While U try to upgrade solaris it first tries to check the installed softtware & application and patch's specific to the exsisting version b'coz these patch are specific to version in most cases.Since in Ur case the authentication is done in ldap it would become bit of a mess if U upgrade.

  • Has anyone set up a Solaris 8 LDAP client to use with iPlanet DS 5.0?  I have only found docs for compiling OpenLDAP and have had NO LUCK with it. I can't get an LDAP client to run.

    help with client
    error on ldap_client_file
    ldap_client_cred

    Hi,
    Yes it can be done provided U've given proper information during configuring.The sun machine which is to be used as a client should be installed as a ldap client "at the time of installation ldap client option should be chosen.

  • In looking at my calendar for January, I found all the entries from last year. I thought I would delete the while month and start over, but it deleted all calendars from icloud.  Can I get them restored and how.  Stoormy

    In looking at my calendar for next year I found all the entries from last year were there as well as a few more  I intended to delete January and just start over but everything was deleted including from icloud,  Any way I can get those restored.
    Thanks  Glenn

    Maybe here:
    iCloud: Troubleshooting creating backups

  • How can I get record count with a query?

    In Client/Server pplication,the client send a query to server.
    How can server get record count by oracle call interface?
    Is it need execute "select count(*) from ...."?

    Yes.
    Either that or increment a counter for each record fetched and
    loop round until you hit the last record.
    The first method would be more efficient on large datasets.

  • HT201365 How can I get around the system lock pin code  if I dont know what it is? I have my username and passwork

    I have switched on my MAC after 2 months of no use and I am getting the grey screen asking for a system lock pin code, I dont know what it is, how can I get into my MAC?
    Many thanks
    Graham

    That sounds like it's requestion the Find My Mac passcode.  If you don't know it, you'll have to take it to a nearby Apple store with proof of purchase/ownership as only they can unlock it for you.

Maybe you are looking for

  • Migration problem

    I am trying to migrate from 10.6.8 to 10.8.2 two iMacs I am following http://support.apple.com/kb/HT4413 instructions I have connected both imacs with an ethernet cable. 10.8 migratgion app asks me to close all open programs, 10.6 do not but I closed

  • Base unit to change in material master

    we  assigned base unit of measurement to one of our material code say KM and after that we created routing .When we come to know that base unit is wrong and instead of KM base unit required was KG then we delete routing for the material.After that wh

  • PC as a bluetooth Device and accept input from other devices

    I need to set my PC up as a bluetooth device by use of a bluetooth dongle connected to my PC. I need to have a program running on my PC that will detect other bluetooth devices and connect with them, accept input from them. Please help me do this. an

  • Line of item in invoice

    Hi, Can anyone tell me how we can fix the line of item in invoice ? Thanks in advance.............. Sanjay

  • SomeString.split(" ")   is there an easy way

    Is there an easy way to split a sting into an array and leave out indexes that contain what I am spliting by? the string I want to split is : "Average 43 40 16 1" lets say I am spliting the string with " " String[] someStrings = someString.split(" ")