我正在制作活动预订表格,我需要用户能够点击日历上的表格单元格来选择他们的开始日期。
可悲的是,我对Javascript的了解有限,过去几个月我全力支持PHP。
据我所知,我需要执行某种ajax操作来获取' GET'日期(例如2016/9/16)并将其作为POST数据与其余表单数据一起发送。我很幸运地参加了udemy的AJAX课程。
到目前为止我有什么。
这是我的表格
日历是简单的表格,每天都是指向特定网页的链接,其中包含example/2016/5/4
等网址中的数据。
以下是我如何生成日历......
{table_open}<table id="tt-calendar">{/table_open}
{heading_row_start}<tr>{/heading_row_start}
{heading_previous_cell}
<th class="text-center">
</th>
{/heading_previous_cell}
{heading_title_cell}
<th class="text-center" colspan="{colspan}">
<h4>
{heading}
</h4>
</th>
{/heading_title_cell}
{heading_next_cell}
<th class="text-center">
</th>
{/heading_next_cell}
{heading_row_end}</tr>{/heading_row_end}
{week_row_start}<tr>{/week_row_start}
{week_day_cell}
<td>
<strong>
{week_day}
</strong>
</td>
{/week_day_cell}
{week_row_end}</tr>{/week_row_end}
{cal_row_start}<tr>{/cal_row_start}
{cal_cell_start}<td>{/cal_cell_start}
{cal_cell_start_today}<td id="tt-calendar-today">{/cal_cell_start_today}
{cal_cell_start_other}<td id="tt-calendar-test">{/cal_cell_start_other}
{cal_cell_content}
<a id="tt-calendar-event" href="' . base_url() . 'schedule/today/' . $year . '/' . $month . '/{day}/' . $student_id . '">
{day}
</a>
{/cal_cell_content}
{cal_cell_content_today}
<a href="' . base_url() . 'schedule/today/' . $year . '/' . $month . '/{day}/' . $student_id . '">
{day}
</a>
{/cal_cell_content_today}
{cal_cell_no_content}
<a href="' . base_url() . 'schedule/today/' . $year . '/' . $month . '/{day}/' . $student_id . '">
{day}
</a>
{/cal_cell_no_content}
{cal_cell_no_content_today}
<a href="' . base_url() . 'schedule/today/' . $year . '/' . $month . '/{day}/' . $student_id . '">
{day}
</a>
{/cal_cell_no_content_today}
{cal_cell_blank} {/cal_cell_blank}
{cal_cell_other}{day}{/cal_cel_other}
{cal_cell_end}</td>{/cal_cell_end}
{cal_cell_end_today}</td>{/cal_cell_end_today}
{cal_cell_end_other}</td>{/cal_cell_end_other}
{cal_row_end}</tr>{/cal_row_end}
{table_close}</table>{/table_close}
那么......我如何制作日历&#39;&#39;元素一个可选择的形式&#39;能够将其POST数据与其他表单发布数据一起传递的元素? 有关额外文章/教程的链接将不胜感激......
答案 0 :(得分:1)