Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Datetime Picker Problems

Status
Not open for further replies.

jennuhw

MIS
Apr 18, 2001
426
US
I originally posted this in the java forum, but I was redirected.

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!


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%>
 
Are you embedding an ActiveX control in your web page?

When you say that you tried the Java forum ... did you mean JavaScript or plain Java ?
 
Yes, it is the Microsoft Date and Time Picker. I originally posted in the javascript forum. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top