Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   Java Script-Date in textfield (http://www.go4expert.com/forums/java-script-date-textfield-t22108/)

vkwd7 15May2010 18:10

Java Script-Date in textfield
thanks and good wishes to all members from a novice!
I am making a calculator in Java script where in a date is entered by user in the textbox in a form.I want that this date should be used in the progam.eg. the user types say 25-4-2000 . and if the date lies between 13-11-2002 to 1-11-2003, his ' var Da' is 26 and else it is 36.
I have written the following code but donot know how to proceed further.Please help.
is it possible to determine which date is greater amongst the two without using the parse method.ie. how to find out whether date entered by user is > or < than the date 1-11-2003?
HTML Code:

<script type="text/javascript">
function Pension(form)
var dt1=form.dor.value;
dt2=new Date ('13-11-2002');
var DA=0;
if ( (dt1) <= (dt2))
<!-- done hiding from old browsers -->

<form id="form1" name="form1" method="post" action="">
<input type="text" name="dor" id="textfield" />
DOR </p>
<input type="text" name="da" readonly size="10" />
<input type="text" name="bp" id="textfield3" />
<input type="button" name="cal" id="cal" value="calculate" onclick=Pension(this.form) />

All times are GMT +5.5. The time now is 12:33.