ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old August 26th, 2003, 01:35 AM
sumicooldude sumicooldude is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 48 sumicooldude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to sumicooldude
Unhappy Retrieving Dates in drop-down Menus

Dear All,

i have a web page to insert dates, and i use the drop-down menu to allow users to select the date ie (the day, the month & the year in 3 diff drop down menus respectively) & then when he presses add button, i collect the data & store it in one variable in dd-mmm-yyyy format & insert it into 1 field of my dbase (say, idate), this is working fine.

The real problem is when i want to diplay the same date in an update page it can only be displayed in a textbox & that too in a mm/dd/yyyy format, is there ne way of retrieving the same date in three diff dropdown menus (ie day, month & year) exactly the same format i asked the user to input.

please help

regards
Sumeet
__________________
the coolest one

Reply With Quote
  #2  
Old August 26th, 2003, 09:37 PM
sumicooldude sumicooldude is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 48 sumicooldude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to sumicooldude
Question Please Reply

Guys no reply from nebody, am eagerly waiting for ur valuable suggetions

Reply With Quote
  #3  
Old August 27th, 2003, 02:55 AM
EiSa EiSa is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Sep 2002
Location: Norway
Posts: 184 EiSa User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 22 m 24 sec
Reputation Power: 7
Something like this perhaps:
PHP Code:
<%
   
myString "24-Dec-2003"
   
myArray Split(myString"-")
%>
   <
form name="form1">
   <
select name="select1">
   <
option value="<%=myArray(0)%>"><%=myArray(0)%></option>
   </
select>
      <
select name="select2">
   <
option value="<%=myArray(1)%>"><%=myArray(1)%></option>
   </
select>
      <
select name="select3">
   <
option value="<%=myArray(2)%>"><%=myArray(2)%></option>
   </
select>
   </
form

Reply With Quote
  #4  
Old August 27th, 2003, 07:32 AM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 8 m 57 sec
Reputation Power: 9
Send a message via ICQ to stumpy Send a message via MSN to stumpy
On the update page, you need to generate the drop down using a script. That way you can matched your stored value with one from the drop down.

e.g. something like this for your Day selector
Code:
for idx = 1 to 30
  response.write("<option value=""" & idx & """")
  if varStoredDate = idx then
    response.write(" selected")
  end if
  response.write(">" & idx & "</option>")
next

Reply With Quote
  #5  
Old August 27th, 2003, 08:19 PM
aspnewbie aspnewbie is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: The Great White North
Posts: 361 aspnewbie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 50 sec
Reputation Power: 7
Send a message via MSN to aspnewbie
I have a function called getdate that I use for this purpose.

So on my edit page it reads:

frommonth = month(oRS("Date"))
fromday = day(oRS("Date"))
fromyear = year(oRS("Date"))

Code:

<Select name="frommonth"><%=getdate("mm",frommonth)%>
</select>&nbsp;&nbsp;
<Select name="fromday"><%=getdate("dd",fromday)%>
</select>&nbsp;&nbsp;
<Select name="fromyear"><%=getdate("yyyy",fromyear)%>
</select>


then I retrieve the info as follows:

smonth = request.form("frommonth")
syear = request.form("fromyear")
sday = request.form("fromday")
sdate = smonth & "/" & sday & "/" & syear

and update from there

Let me know if you need help writing the function.

Reply With Quote
  #6  
Old August 28th, 2003, 01:01 AM
sumicooldude sumicooldude is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Feb 2003
Posts: 48 sumicooldude User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via Yahoo to sumicooldude
Talking thnx a bucks

Dear All,

well i must say that u guys are really really good, that did helped a lot & the last solution was the perfect 1 for my problem.

thnx once again to all for this help

regards
Sumeet

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Retrieving Dates in drop-down Menus


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT