Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
display curent date and last one months date in javascript
Old 05-03-2007, 05:59 PM display curent date and last one months date in javascript
Experienced Talker

Posts: 35
Name: remya
Trades: 0
i'm using ASP with MSAccess as database.
i have two buttons and two textbox in my page.
when i press my first button (First month) i need to display the current month in one textbox and last one months date in another textbox.
and while pressing the second button (submit) i need to display the date displayed in the textbox as itself and the records between thoses two dates. if that date is still there in the textbox only i can sort the records.
in vbScript i tried to display the current date and last months date like this.

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

so any idea how to write this function in javascript.....
if you know please help me.
Thanks in advance... sub onemonth() form1.datefrom.value = dateadd("m",-1,date()) form1.dateto.value = date() end sub
remya1000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-04-2007, 12:28 AM Re: display curent date and last one months date in javascript
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
You don't need Javascript at all to do it. This can be done purely with ASP.
Code:
Response.Write "<input name=""datefrom"" type=""text"" size=""10"" value=""" & dateAdd ("m", -1, Date()) & """ />"
Response.Write "<input name=""dateto"" type=""text"" size=""10"" value=""" & Date() & """ />"
This will spit out two input fields with the values you want. Just put that ASP code where you want the fields (and any other stuff.)
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 05-04-2007, 10:34 AM Re: display curent date and last one months date in javascript
Experienced Talker

Posts: 35
Name: remya
Trades: 0
but the problem is that i'm able to display current months and last months date in textbox using the Asp as u said.
but if i press another button, i need the content in that text to display again in that text and display the records.
if two textbox contain the currentdate and last months date and someone changed that date before pressing the button, then that new date should be displayed, instead of current month and last month.
and like last month i have 3month,6months button also. so what ever there in textbox, that i need to display again in that textbox to sort that record with those two dates.
any idea... if you have anyidea please help me.
thanks in advance
remya1000 is offline
Reply With Quote
View Public Profile
 
Old 05-04-2007, 02:39 PM Re: display curent date and last one months date in javascript
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Oh, I see what you mean.

http://www.dynarch.com/projects/calendar/

If you mess with this script enough, you'll be able to get what you want.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Reply     « Reply to display curent date and last one months date in javascript
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46558 seconds with 12 queries