• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Is this a javascript question?

Participant ,
Dec 28, 2009 Dec 28, 2009

Copy link to clipboard

Copied

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

TOPICS
Advanced techniques

Views

786

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 28, 2009 Dec 28, 2009

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 29, 2009 Dec 29, 2009

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 03, 2010 Jan 03, 2010

Copy link to clipboard

Copied

Dan,

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

Thanks,

djkhalif

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 03, 2010 Jan 03, 2010

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jan 03, 2010 Jan 03, 2010

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 09, 2010 Jan 09, 2010

Copy link to clipboard

Copied

LATEST
Is this a javascript question?

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation