JoeVB
07-26-2006, 06:54 PM
I just started js this week, I like it so far but I have a problem I need help with.
I have a VB.NET/ASP.NET project, in this project I have included freeware in the form of a date picker from a calendar. It is a .js file that I have included in my asp page. The calendar does exactly what it is meant to do. I am trying to add some code to do a date calculation between the current date and the date selected, the result I want is the number of days between the two.
I have put in the alerts just for testing:
function ECMDurationDays() {
var licDateExp = document.getElementById('txtECMDuration').value;
alert(licDateExp);
var licDateNow = new Date(Date.parse(new Date().toDateString()));
alert(licDateNow);
alert(Math.round((licDateExp-licDateNow)/864e5));
{return Math.round((licDateExp-licDateNow)/864e5);} //divide by 864e5 to get milliseconds to day
document.getElementById('txtECMDuration').value = 'test';//ECMDurationDays();
I know I am getting into this function because I get the alert messages. I also know the calendar can write to the text box on the web form. So, I am trying to take the date the person selects and do the math and stuff it in a textbox called txtECMDurationDays.
I get no errors, got past all those. It just doesn't write to the textbox. Not sure where to go from here.
Anyone?
I have a VB.NET/ASP.NET project, in this project I have included freeware in the form of a date picker from a calendar. It is a .js file that I have included in my asp page. The calendar does exactly what it is meant to do. I am trying to add some code to do a date calculation between the current date and the date selected, the result I want is the number of days between the two.
I have put in the alerts just for testing:
function ECMDurationDays() {
var licDateExp = document.getElementById('txtECMDuration').value;
alert(licDateExp);
var licDateNow = new Date(Date.parse(new Date().toDateString()));
alert(licDateNow);
alert(Math.round((licDateExp-licDateNow)/864e5));
{return Math.round((licDateExp-licDateNow)/864e5);} //divide by 864e5 to get milliseconds to day
document.getElementById('txtECMDuration').value = 'test';//ECMDurationDays();
I know I am getting into this function because I get the alert messages. I also know the calendar can write to the text box on the web form. So, I am trying to take the date the person selects and do the math and stuff it in a textbox called txtECMDurationDays.
I get no errors, got past all those. It just doesn't write to the textbox. Not sure where to go from here.
Anyone?