HTML Calendar form and input arrays

Posted by Christopher Ickes on Stack Overflow See other posts from Stack Overflow or by Christopher Ickes
Published on 2011-01-31T23:22:08Z Indexed on 2011/01/31 23:26 UTC
Read the original article Hit count: 286

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about php

Related posts about html