In doing some research I came accross some help Jeremy Miller had given with the tcal script and would like to see if he or others could help me with what seems to be a simple issue, but I can't find any documentation to help.
I have a simple form for the local photographic society that writes to MySql. It has two fields a start date and end date for events. If when displaying the event to the public both dates are the same it only displays the one date if not the same then it displays both dates.
The input on the back end to enter the dates looks like this:
Quote:
<tr>
<td class="title-background">Workshop Date</td>
<td class="table-background">Start date:</td>
<td class="table-background"><input type="text" name="workshop_date_start" maxlength="20" value="{workshop_date_start}" size="20">
<script language="JavaScript">new tcal ({
// form name
'formname': 'EditWorkshop',
// input name
'controlname': 'workshop_date_start'
});
</script>
</td>
<td class="table-background">End date:</td>
<td class="table-background"><input type="text" name="workshop_date_end" maxlength="20" value="{workshop_date_end}" size="20">
<script language="JavaScript">new tcal ({
// form name
'formname': 'EditWorkshop',
// input name
'controlname': 'workshop_date_end'
});
</script>
</td>
</tr>
|
What I want to be able to do is one of two options:
Option a) When field workshop_date_start is updated by tcal it sets workshop_date_end to the same value at the same time. Thus when editing the end date and opening the field in tcal it will show on the mini calendar the date the event is starting for quicker refence in pickig a closing date, or the user would not have to touch the second field at all if it is a one day event since both field would match.
or
Option b) Not using tcal at all and anytime the workshop_date_start field is updated (even if typed in without using the tcal script) it looks to see if workshop_date_end is greater and if not sets it equal to workshop_date_start in real time. Something along the line of using onfocusout for the date_start field to run a script and check if date_end is greater and if not then seting date_end to the same value as date_sart in the form???
Any suggestions?
|