6 Replies Latest reply on Jan 9, 2010 7:58 AM by BKBK

    Is this a javascript question?

    djkhalif

      Good evening all,

       

      I have to build a web app that mirrors an Access app that is VB based. One problem I am having is in our Inspection Form. I used <cfloop list = j> to perform a list qualify but, what I need is:

       

      1. Have users inspect products

      2. Identify how many products inspected

      3. Identify the defective products on an order

      4. Identify the specific defect per specific product without re-entering the order

      5. Complete the inspection then enter the new order

       

      For example, order J32579 has 15 products. Product 1 has Cracked Bulb and 14 has Gum in the case.

       

      I want to enter J32579 in Orders with ID 235 then, Product Defective in Defects with:

       

       

      ID   Unit Defect Order

      235  1     19     J32579

      235 14     7      J32579

       

      I can write the query but, I am unsure about how to correlate the unit to defect without entering the order number twice. I know its late.

       

       

      Thanks in advance,

       

      djkhalif

        • 1. Re: Is this a javascript question?
          Dan Bracuk Level 5

          Yes it's a javascript question.  At least to develop the form. I'd do something like this:

           

          <cfsavecontent variable = "whatever">

          cf html code to produce a text box (or two) and a set of checkboxes, one for each possible defect.

           

          Pass this variable to javascript.   Write two javascript functions.  One adds a div containing the stuff from the cfsavecontent.  The other adds a submit button.  For the first one, you are going to have to do some fancy coding to add numbers to the end of the form fieldnames so you can marry up the text boxes and checkboxes on your action page.

           

          Give the user two things to select.  They will call the two javascript functions.

           

          Somewhere on your action page, you will have to loop through either the form collection or the form.fieldnames list, whichever you are more comfortable with.

          • 2. Re: Is this a javascript question?
            djkhalif Level 1

            Hi Dan,

             

            After thinking about it, this will be the same as a shopping cart. The first defects and products will be stored but the first form will create an order id for the initial entry. Essentially, the products and defects go into the cart and can be added to. I will have to create a session id that will speak to both tables. Any input is valuable.

             

            Thanks,

             

            djkhalif

            • 3. Re: Is this a javascript question?
              djkhalif Level 1

              Dan,

               

              Do you have an example of this? I'm kind of stuck, big time.

               

              Thanks,

               

              djkhalif

              • 4. Re: Is this a javascript question?
                Dan Bracuk Level 5

                I have an example of using cfsavecontent to produce some cf/html stuff that gets sent to javascript, but the page uses innerHTML which I believe is IE only.  Plus, it will only get you started.  It won't add form fields with dynamic names, such as input1, input2, etc.

                • 5. Re: Is this a javascript question?
                  djkhalif Level 1

                  Dan,

                   

                  Thanks. I decided to go a different route for now. The problem I kept running into was, whenever I submitted the form it would add the work order with a new id and render the products with new ids. I used IF NOT EXISTS in my cfquery and added a back button. I can get back to the javascript during the week but, I really needed to populate my table correctly.

                   

                   

                  Thanks,

                   

                  djkhalif

                  • 6. Re: Is this a javascript question?
                    BKBK Adobe Community Professional & MVP
                    Is this a javascript question?

                    No. From your explanation, it has little or nothing to do with Javascript.