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.

ASP.NET Forum


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



Reply
Drop Down With Curent Date
Old 03-02-2006, 09:59 AM Drop Down With Curent Date
dahak's Avatar
Skilled Talker

Posts: 60
Location: Romania
Trades: 0
hello guys,
I want to make 3 drop downs that will have the initial value the curent date...
Day,month,year...
i have done this,but this only gets the curent date + 2.
I need the drop down to be initialy selected with the curent day but also to have 30 days,7 days.The year is Ok like this.

PLEASE SOMEONE HELP ME !!!!!!!!!!!!!!!!!!!!!!!!!!
THANKA ALOT!!!

HTML Code:
    <!------------Day -------------->
     <select name="day" size="1">
         <%=("<option value=""" & Curday & """>" & Curday & "</option><option value=""" & Curday + 1 & """>" & Curday + 1 & "</option><option value=""" & Curday + 2 & """>" & Curday + 2 & "</option>") %>
         </select>
     <!--------------------------->
    <!------------MONTH -------------->
     <select name="month" size="1">
         <%=("<option value=""" & Curmonth & """>" & Curmonth & "</option><option value=""" & Curmonth + 1 & """>" & Curmonth + 1 & "</option><option value=""" & Curmonth + 2 & """>" & Curmonth + 2 & "</option>") %>
         </select>
     <!------------------------------->
    <!------------YEAR -------------->
        <select name="year" size="1">
         <%=("<option value=""" & CurYear & """>" & CurYear & "</option><option value=""" & CurYear + 1 & """>" & CurYear + 1 & "</option><option value=""" & CurYear + 2 & """>" & CurYear + 2 & "</option>") %>
         </select>
      <!------------------------------->
            </td>
            <td>
    <!------------Day -------------->
     <select name="day" size="1">
         <%=("<option value=""" & Curday & """>" & Curday & "</option><option value=""" & Curday + 1 & """>" & Curday + 1 & "</option><option value=""" & Curday + 2 & """>" & Curday + 2 & "</option>") %>
         </select>
      <!------------------------------->
    <!------------MONTH -------------->
     <select name="month" size="1">
         <%=("<option value=""" & Curmonth & """>" & Curmonth & "</option><option value=""" & Curmonth + 1 & """>" & Curmonth + 1 & "</option><option value=""" & Curmonth + 2 & """>" & Curmonth + 2 & "</option>") %>
         </select>
     <!------------------------------->     
    <!------------YEAR -------------->
        <select name="year" size="1">
         <%=("<option value=""" & CurYear & """>" & CurYear & "</option><option value=""" & CurYear + 1 & """>" & CurYear + 1 & "</option><option value=""" & CurYear + 2 & """>" & CurYear + 2 & "</option>") %>
         </select>
     <!------------------------------->
dahak is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-10-2006, 01:58 PM Re: Drop Down With Curent Date
WebcyteDesign's Avatar
Registered User

Posts: 159
Location: Hamilton
Trades: 0
Run a loop and when the day of the loop matches the current date <option .... selected>
WebcyteDesign is offline
Reply With Quote
View Public Profile Visit WebcyteDesign's homepage!
 
Old 03-13-2006, 03:24 PM Re: Drop Down With Curent Date
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
http://truegeeks.com/asp/aspexamples/gendate/edate1.asp

This will work with or without the Javascript (all the Javascript does is ensures that an invalid date can't be selected, such as February 30 or April 31).

You just have to make sure that, when you process the form input, you use the select boxes and not the hidden input field (since the hidden input field only works with Javascript). I've gotten burnt way too many times that way.
__________________

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 Drop Down With Curent Date
 

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.52121 seconds with 12 queries