HTML Calendar form and input arrays
- by Christopher Ickes
Hello. Looking for the best practice here...
Have a form that consists of a calendar. Each day of the calendar has 2 text input fields - customer and check-in. What would be the best & most efficient way to send this form to PHP for processing?
<form action="post">
<div class="day">
Day 1<br />
<label for="customer['.$current['date'].']">Customer</label>
<input type="text" name="customer['.$current['date'].']" value="" size="20" />
<label for="check-in['.$current['date'].']">Check-In</label>
<input type="text" name="check-in['.$current['date'].']" value="" size="20" />
<input type="submit" name="submit" value="Update" />
</day>
<div class="day">
Day 2<br />
<label for="customer['.$current['date'].']">Customer</label>
<input type="text" name="customer['.$current['date'].']" value="" size="20" />
<label for="check-in['.$current['date'].']">Check-In</label>
<input type="text" name="check-in['.$current['date'].']" value="" size="20" />
<input type="submit" name="submit" value="Update" />
</day>
</form>
Is my current setup good? 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.