|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
Guys no reply from nebody, am eagerly waiting for ur valuable suggetions
|
|
#3
|
|||
|
|||
|
Something like this perhaps:
PHP Code:
|
|
#4
|
||||
|
||||
|
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
|
|
#5
|
|||
|
|||
|
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>
<Select name="fromday"><%=getdate("dd",fromday)%>
</select>
<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. |
|
#6
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > Retrieving Dates in drop-down Menus |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|