I'm writing an asp with connection to MS SQL Server 2000 and I would like to use this calendar ( http://www.dynamicdrive.com/dynamici...oncalendar.htm ) to input and update dates. I have some functions to initialize the date field which is to be submited and this is how I do it:
Here is the problem, this code works fine and initializes the calendar:HTML Code:<script> function getDatePicker() { return this.form_name.orderdate.value; } function initDateOfCutOff() { this.form_name.DateOfCutOff.value = getDatePicker(); } </script> ... <input type="submit" class="btn" name="update" value="Save" onClick="initDateOfCutOff()">
But the effect of this code is no calendar shown, although details.Fields.Item("DateOfCutOff") equals 11/24/2005:HTML Code:<input type="hidden" name="oldDateOfCutOff" value="<%= details.Fields.Item("DateOfCutOff") %>"> <script>DateInput('orderdate', false, 'MM/DD/YYYY', '11/24/2005')</script> <input type="hidden" name="DateOfCutOff"> <input type="button" onClick="alert(this.form.oldDateOfCutOff.value.toString())" value="Show old date value">
The effect of this code is also no calendar shown:HTML Code:<input type="hidden" name="oldDateOfCutOff" value="<%= details.Fields.Item("DateOfCutOff") %>"> <script>DateInput('orderdate', false, 'MM/DD/YYYY', this.form.oldDateOfCutOff.value.toString())</script> <input type="hidden" name="DateOfCutOff"> <input type="button" onClick="alert(this.form.oldDateOfCutOff.value.toString())" value="Show old date value">
I'll be very thankful if you help me. Thank you in advance!HTML Code:<input type="hidden" name="oldDateOfCutOff" value="11/24/2005"> <script>DateInput('orderdate', false, 'MM/DD/YYYY', this.form.oldDateOfCutOff.value.toString())</script> <input type="hidden" name="DateOfCutOff"> <input type="button" onClick="alert(this.form.oldDateOfCutOff.value.toString())" value="Show old date value">



Reply With Quote
Bookmarks