I am using Microsoft's datetime picker. I have a beginning and end date. I want the end date to equal the beginning date if the beginning date has changed.
I tried onchange event, but it never fired off. I changed this to the onblur which works, kinda. If you use the mouse to change the date then click on the end date or type in the new beginnning date and click on any other field, it works great. The problem is if you click to choose a new date in the beginning field, and click anywhere but the corresponding end date field, it won't change the end date. Thanks!
I tried onchange event, but it never fired off. I changed this to the onblur which works, kinda. If you use the mouse to change the date then click on the end date or type in the new beginnning date and click on any other field, it works great. The problem is if you click to choose a new date in the beginning field, and click anywhere but the corresponding end date field, it won't change the end date. Thanks!
Code:
<script language = "javascript">
function changeDate(dateField)
{
var lastField = "Date" + dateField + "end";
var firstField = "Date" + dateField;
document.getElementById(lastField).value = document.getElementById(firstField).value;
}
</script>
<%for x = 1 to 5%>
<tr><td><object id="Date<%=x%>" name="Date<%=x%>" width="83" height="23" classid="CLSID:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1" onblur="changeDate(<%=x%>)"></object></td>
<td><object id="Date<%=x%>end" name="Date<%=x%>end" width="83" height="23" classid="CLSID:20DD1B9E-87C4-11D1-8BE3-0000F8754DA1"></object></td>
<td><input type="text" name="Hours<%=x%>" size = 3 maxlength=4></td>
</tr>
<%next%>