![]() |
| I need a tutorial |
|
2onboard
|
I need to do the following, but not sure how to get started, advice or a tutorial would be great.
I have a form that I have 12 rows (one for each month) Next to each month I have a cfinput text box to allow for an amount to be entered for each month January _____ February _____ March _____ etc. I want to have one submit button that submits all values year (set previously in code) month (as a number 1, 2, 3, etc.) and the amount entered in the box so the DB would look something like ID Rental Year Rental Month Rental Rate 22 2010 1 3000 23 2010 2 3500 24 2010 3 3750 etc but I'm not sure how to procede?? I can do a cfloop from 1 to 12 index m - to create the form, but I don't know how to name things or tie to them together so that things get entered into the DB properly |
||||||||||||
|
|
|||||||||||||
|
cfsearching
|
Just use the loop index "m" to dynamically name the fields: amount1, amount2, ....., amount12. Then on your action page, do another loop to extract and insert the values. Inside each loop, extract the value of each field with array notation:
Though I myself would probably use a little of redundancy to make it a bit more dynamic. But you get the idea. |
|||||||||||||||
|
|
||||||||||||||||
|
2onboard
|
I reallly appreciate the help, but over my head.
Could you supply a more detailed example, or link to tutorial? |
||||||||||||
|
|
|||||||||||||
|
2onboard
|
wait - wait .... I think I get it...
Thanks for your help |
||||||||||||
|
|
|||||||||||||
|
cfsearching
|
Good! Let us know if you need more help.
|
||||||||||||
|
|
|||||||||||||
| I need a tutorial |
|
||
|


