homer09001
12-28-2007, 05:55 PM
for some reason my script seems to loose track of my var: her is the code:
function setvars()
{
var minutes = 1000 * 60;
var hours = minutes * 60;
var d1 = document.pirep.st.value; <-- if i echo this out it works fine
var d2 = document.pirep.lt.value; <-- if i echo this out it work fine
var e = Date.parse(d1); <-- this var returns NaN to the browser?
var e1 = Date.parse(d2); <-- this var returns NaN to the browser also?
var y = e/minutes;
var y1 = e1/minutes;
var final = y1-y;
document.pirep.st.value = d1;
document.pirep.lt.value = d2;
document.pirep.th.value = final;
}
i can't work out for the life of me why it isnt working?
function setvars()
{
var minutes = 1000 * 60;
var hours = minutes * 60;
var d1 = document.pirep.st.value; <-- if i echo this out it works fine
var d2 = document.pirep.lt.value; <-- if i echo this out it work fine
var e = Date.parse(d1); <-- this var returns NaN to the browser?
var e1 = Date.parse(d2); <-- this var returns NaN to the browser also?
var y = e/minutes;
var y1 = e1/minutes;
var final = y1-y;
document.pirep.st.value = d1;
document.pirep.lt.value = d2;
document.pirep.th.value = final;
}
i can't work out for the life of me why it isnt working?