Hi all -
I've searched all over the forums trying to find an answer to my problem without much luck. Hopefully someone here can help me.
I have an HTML table inside a form where each row of the table is populated with data from a db query. Each row also has a hidden input that contains the quantity of items on hand and a text input where the user will input the actual count of the items. When the form is submitted, I want to compare qty on hand and qty counted, display any discrepancies, and allow the user to input a reason for the discrepancy.
Here's my problem. What is the best way to name the hidden field and the text input in order to process the form post results? I've looked at possibly using arrays like $qtyOnHand[] and $qtyCounted[] and comparing the values in a loop, but I may also have to keep up with the item number and the item description without querying the DB again. Would arrays still be the best way to handle this? What about some way to create an array for each unique item? Or would I do better to just create some kind of unique variable name by appending the item number onto the name?
Thanks for your help,
-- phil --