3 Replies Latest reply on Aug 8, 2006 12:08 AM by shibu_narayanan

    Multiple Inserts based on check box?

    mikeap Level 1
      I have an insert form that depending on if checkboxes are checked, inserts the data. How can I insert a record for the number of check boxes checked?

      Example:
      CB 1 = Checked
      CB 2 = Not Checked
      CB 3 = Checked

      So I need to insert a record for CB 1 and CB 2. How can I do this?

      What I'm doing is tying a sales lead to the sales man selected. I'm using check boxes because I figured it was easiest but I'm open to suggestions.
        • 1. Re: Multiple Inserts based on check box?
          shibu_narayanan
          I think all your problem depends on how you named your checkboxes.

          If you have given the same name for the checkboxes you will get the values onto the server as a list item...
          and you can directly loop through the list for your Insert query... And the best part is that only the selected values will be transfered to the server. So you can just go on to insert the data with whatever value is returned from the client side.

          And if you are using different names for the checkboxes you have to check ith with the FORM Structure.. Here also you have various functions available in CF to handle and retrieve values from the structure... I think StructFind function will be of gud use for you...


          Have a great time with coding CF...
          Shibu Narayanan
          • 2. Re: Multiple Inserts based on check box?
            shibu_narayanan Level 1
            I think all your problem depends on how you named your checkboxes.

            If you have given the same name for the checkboxes you will get the values onto the server as a list item...
            and you can directly loop through the list for your Insert query... And the best part is that only the selected values will be transfered to the server. So you can just go on to insert the data with whatever value is returned from the client side.

            And if you are using different names for the checkboxes you have to check ith with the FORM Structure.. Here also you have various functions available in CF to handle and retrieve values from the structure... I think StructFind function will be of gud use for you...


            Have a great time with coding CF...
            Shibu Narayanan
            • 3. Re: Multiple Inserts based on check box?
              shibu_narayanan Level 1
              I think all your problem depends on how you named your checkboxes.

              If you have given the same name for the checkboxes you will get the values onto the server as a list item...
              and you can directly loop through the list for your Insert query... And the best part is that only the selected values will be transfered to the server. So you can just go on to insert the data with whatever value is returned from the client side.

              And if you are using different names for the checkboxes you have to check ith with the FORM Structure.. Here also you have various functions available in CF to handle and retrieve values from the structure... I think StructFind function will be of gud use for you...


              Have a great time with coding CF...
              Shibu Narayanan