EDIT take 2:
Each "calendar_date" is an object with attributes "customer" and "check-in".
What is the best way to show multiple "calendar_d开发者_开发知识库ate"s in a form where attributes "customer" and "check-in" can be updated for each date?Do...
<input type="text" name="customer[<?php echo $calendar_date?>]" />
<input type="text" name="check-in[<?php echo $calendar_date?>]" />
For each date?
This creates 2 separate PHP arrays $customer and $check-in for every date where the date is the index key and the value is the form input for that field.
Is this a good approach or is there a better approach?
I feel there has to be a better option. My concern involves processing a whole year at once (which can happen) and adding additional text input fields.
I'm not sure what your question is either. If you just need the same value to be put in multiple places, you can skip the bloated HTML with many input fields, get that value once and append it where you need when you're processing the POST/GET with PHP.
精彩评论