i'm able to display the corresponding dates in two textbox while clicking the buttons "Last 1 Month" and "Last 3 Month".
and while pressing the Submit button the dates displayed in the textbox should be display in that textbox itself.
if we changed the date after the display in that textbox , then the new dates should be displayed while pressing the submit button.
this is the code i tried to get the value displayed i the textbox and display it while we press submit button.

<html>
<head>

<script language="VBScript">
sub onemonth()
form1.datefrom.value = dateadd("m",-1,date())
form1.dateto.value = date()
end sub
sub threemonth()
form1.datefrom.value = dateadd("m",-3,date())
form1.dateto.value = date()
end sub
sub viewrecord()
form1.datefrom.value = strdatefrom
form1.dateto.value = sttrdateto
end sub
</script>

</head>
<body>

<form name="form1" method="post">
<BR>
<input type="button" value="Last 1 Month" name="buttonname" onclick="onemonth"/>
<input type="button" value="Last 3 Month" name="buttonname" onclick="threemonth"/>
<input id="datefrom" type="text" name="datefrom" size="20"/>
<input id="dateto" type="text" name="dateto" size="20"/>
<input name="b2" type="button" VALUE="Submit" onclick="viewrecord()"/>

<% Dim strdatefrom, strdateto
strdatefrom = trim(Request.form("datefrom"))
strdateto = trim(Request.form("dateto")) %>

</form>
</body>
</html>

but its not taking the values Request.form("datefrom").
and if we use button, it will display the dates in textbox. but if we use submit it will show the date a glance and make the textbox blank. we wont be able to see the date if we give submit.
and we post will be done by submit button, and if we give button, it wont post the value.
if you have any idea what wrong in my code just help me.
how can i make this display the content in the textbox to the same textbox after clicking a button or submit button.
thanks in advance