onchange

D

displayname

I want to calculate in javascript the number of days between two dates as
soon as either of the dates is changed. I use onchange="calculateDays();". It
works fine if you type in a new date. But, if you change the date by
selecting a date from a calendar icon next to the date field, it does not
think the field has changed and thus the javascript function is not invoked.
How should that be fixed? The same thing happens with onclick. Thank you.
 
B

Bob Barrows

displayname said:
I want to calculate in javascript the number of days between two
dates as soon as either of the dates is changed. I use
onchange="calculateDays();". It works fine if you type in a new date.
But, if you change the date by selecting a date from a calendar icon
next to the date field, it does not think the field has changed and
thus the javascript function is not invoked. How should that be
fixed? The same thing happens with onclick. Thank you.

Client-side scripting problems should be posted at m.p.scripting.jscript
or comp.lang.javascript. There is no ASP involved with this question.

That said, you will need to modify the function of that calendar control
that updates your textbox to have it call your function. Given that
there are thousands of javascript calendar controls out on the web, that
is as detailed as I can get.
 
D

displayname

Thank you.

Bob Barrows said:
Client-side scripting problems should be posted at m.p.scripting.jscript
or comp.lang.javascript. There is no ASP involved with this question.

That said, you will need to modify the function of that calendar control
that updates your textbox to have it call your function. Given that
there are thousands of javascript calendar controls out on the web, that
is as detailed as I can get.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,814
Latest member
SpicetreeDigital

Latest Threads

Top