How to disable previous days in default DHTML calendar?
I used the following code,
<script type="text/javascript">
Calendar.setup({
inputField : '_dob',
ifFormat : '%m/%e/%y',
button : '_dob_trig',
align : 'Bl',
singleClick : true,
disableFunc: function(date) {
var now= new Date();
return (date.getTime() < now.getTime());
}
});
</script>
It works in disabling the previous dates. But when we select on valid date, nothing happens. The date is not being added to the text filed of calendar.
If I changes the month and comes back , I can select date!
Any Idea?
Wow!
It might be some javascript error. I was unable to select any dates unless going and coming back from next month…
I past it by giving some if loops. My updated code is below.
Greetings to everyone replied…