hi...
I used pop up calendar to display start date. It works ,
but I have to do automatic calculation for the end date.
So when ever we click the start date pop up calendar, the
text field for end date will automatically display the end date based on the formula i have created.
I tried to used onClick , onChange, onKeyUp for the handler, but it doesn't works. ANy idea ?? thanks in advance...
this is my code:
<script language="JavaScript">
function calenddate() {
var datestart = document.myForm.schestart.value;
var fm = document.myForm;
if (document.myForm.schestart.value != "" ){
// my formula
end = 02-03-2006 ;
fm.schecomp.value = end;
}
}
</script>
<form name="myForm" method="post">
date start:
<input name="schestart" type="text" size="15" onClick="calenddate()">
<a href="javascript:cal1.popup();"> <img src="../cal/cal.gif" width="16" height="16" >
Date end : <input name="schecomp" type="text" size="15" readonly>
<script language="JavaScript">
var cal1 = new calendar1(document.forms['WOForm'].elements['schestart']);
cal1.year_scroll = true;
cal1.time_comp = false;
</script>
</form>
I used pop up calendar to display start date. It works ,
but I have to do automatic calculation for the end date.
So when ever we click the start date pop up calendar, the
text field for end date will automatically display the end date based on the formula i have created.
I tried to used onClick , onChange, onKeyUp for the handler, but it doesn't works. ANy idea ?? thanks in advance...
this is my code:
<script language="JavaScript">
function calenddate() {
var datestart = document.myForm.schestart.value;
var fm = document.myForm;
if (document.myForm.schestart.value != "" ){
// my formula
end = 02-03-2006 ;
fm.schecomp.value = end;
}
}
</script>
<form name="myForm" method="post">
date start:
<input name="schestart" type="text" size="15" onClick="calenddate()">
<a href="javascript:cal1.popup();"> <img src="../cal/cal.gif" width="16" height="16" >
Date end : <input name="schecomp" type="text" size="15" readonly>
<script language="JavaScript">
var cal1 = new calendar1(document.forms['WOForm'].elements['schestart']);
cal1.year_scroll = true;
cal1.time_comp = false;
</script>
</form>