Skip navigation
emartek1
Currently Being Moderated

Problem with form display and linking fields.

Oct 25, 2009 10:07 AM

I have two tables in my database (orders & product orders). Orders would have one record that could have many corresponding records in ProductOrders. The problem is two-fold.

 

1) How do I present the ProductOrders page which consists of 4 drop down menus and 1 text field in a row so that users enter only as many orders as they need to. I dont want to display 20 rows of drop down menus only to have the user input only one order. Ideally I would like to have a way where the product orders page presents the first row and then once filled in would present another row, etc. Is this possible or is there a better way?

 

2) How do I link the Orders.ID to the ProductOrders.OrderID on my submission form? I thought I would display the two pages together using a cfinclude but am unclear how the ID's will be linked. They should all be the same number ie: Orders.ID = 24 then all productorders.OrderID would be 24 too.

 

I hope I'm making sense! Thanks in advance!!

 
Replies
  • Currently Being Moderated
    Oct 26, 2009 8:49 AM   in reply to emartek1

    You may need to provide some codes

     
    |
    Mark as:
  • Currently Being Moderated
    Nov 1, 2009 12:34 AM   in reply to emartek1

    I agree with you. Twenty dropdown lists on a single page is too much.

     

    To go by your description, I would create distinct product pages, say, productPage001.cfm,  productPage002.cfm,  productPage003.cfm, and so on. Then I would put 4 dropdown lists per form per page, and use a table -- even, better, use div and CSS -- to display them in a row.

     

    You could pass the orderID from form/page to form/page as a hidden form-field or as a session variable. Include links (and appropriate Javascript for form submission) on each form/page to proceed to the next, or to the previous, page. Alternatively, use submit buttons.

     

    This also immediately suggests you could apply cfform's preservedata attribute to preserve the selected values in the form fields. You could also use session variables or a database to store the selected values.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points