Prob in populating the current date in drop down

I want to get the current date into a drop down list.
There are three drop down.
1.Month 2. Day 3. Year.
If anytime the page loads there should be current date in the drop down list. and if any one wants to change he can change the date accordingly.
Can any one help me in sorting out this prob.
I can think of getting the current date in the drop down by keeping it in the 1st option of the select tag. But when you click on the list the current date is not at proper location compared to other numbers in the list.
Please reply.
Message was edited by:
aniketh_parmar

function addit(){
var dd = new Date();
var yearnow = dd.getFullYear(); //gets 4 digit year
//use getDate() & getMonth() methods in seperate fns, and populate
//date and months
for (var i=yearnow; i <= yearnow + 25 ;++i){
addOption(document.getElementById("year"), i, i);
function addOption(selectbox,text,value)
var optn = document.createElement("OPTION");
optn.text = text;
optn.value = value;
selectbox.options.add(optn);
}in your jsp:
<body onload="addit();">
<form>
<select name="month">
</select>
<select name="day">
</select>
<select name="year">
</select>
Have a seperate fn, and using the above 3 methods get
today's (current) month, day & year.
then something like,
document.getElementById("year").selectedIndex = currYear;
document.getElementById("month").selectedIndex = currMonth; //0 is Jan and 11 is Dec
document.getElementById("day").selectedIndex = currDate;

Similar Messages

  • Create Variant for dynamic population of current date

    hi,
      How do i create a variant for a DATE to populate the current date in the selection screen?
       Please let me know
    Thanks in advance.

    Hi,
    Go to SE38..
    Press F8..
    Press save button..
    Give the variant name..and description..
    For the corresponding date column Check the check box under the column "L" which says selection variable..
    Press the selection variable button in the application toolbar..
    Click the hotspot Under the column D..Now it will be green..
    Press the drop down ...Choose the current date...
    Save the data and save the variant..
    Now if you choose that variant...The date will automatically be set to the current date.
    THanks
    Naren

  • I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?

    I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?

    I have Elements 11. Sometimes, if I edit a photo in Elements Editor, the date gets changed to the current date. Why does that happen? It doesn't happen all the time, so I can't isolate the cause. Any ideas?

  • FI line items up to the current date

    Hi all,
    I read the SAP note 485958 "BCT-FI:Extracting FI line items up to the current date" and I have some doubts here:
    1. After I've set parameter BWFIOVERLA to 'X' and extract delta at 6PM, will FI data that is changed before 6PM for example a gl entry at 5PM, goes into my delta extraction?
    2. What does BWFITIMBOR mean by having default value 02:00:00?
    3. Is this note applicable if my R3 PI release is at 2003_1_46C?
    Please advise.
    Thank you.
    Celeste

    Hi Celeste,
       Pls go through this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/af/16533bbb15b762e10000000a114084/content.htm
    Excerpts from this link regarding your doubt:
    BWFIOVERLA: The logic of this parameter prevents records with the previous day as their CPU date from still being in the update at the time of extraction.
    If X is set for this parameter, selection is made up to the previous day if the time limit is not reached.
    If <space> is set for this parameter, selection is made up to the day before the previous day if the time limit is not reached.
    BWFITIMBOR: This parameter designates 02.00 (2 A.M.) as the time limit for extraction. If this limit is not reached, the system uses a security interval of one day to determine the To-value of the selection. If extraction is started before 02:00 therefore, the selection takes place only up to the day before the extraction run.
    Hope it helps you!!!!
    Regards,
    Amit

  • Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history again?

    Although my ipod shows the number of steps, calories, and time, it no longer is saving it to the history. Also when I open the history it takes me to May 2010 instead of the current date. Any ideas on how to get it to start recording the history again?

    Try:                                               
    - iOS: Not responding or does not turn on           
    - Also try DFU mode after try recovery mode
    How to put iPod touch / iPhone into DFU mode « Karthik's scribblings
    - If not successful and you can't fully turn the iOS device fully off, let the battery fully drain. After charging for an least an hour try the above again.
    - Try another cable                     
    - Try on another computer                                                       
    - If still not successful that usually indicates a hardware problem and an appointment at the Genius Bar of an Apple store is in order.
    Apple Retail Store - Genius Bar
    The missing apps could have been done by setting the Restrictions that can hid those apps. If the backup was made with those retrictions set the the Restrictions are also restored.
    Thus, if you get it to work restore to factory settings/new iPod, not from backup                               
    You can redownload most iTunes purchases by:        
      Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • How can I make iCal in Lion open to the current date?

    I just updated from Snow Leopard to Lion and have had all of the frustrations with changes to iCal that are well-documented here and elsewhere.  One issue I haven't seen addressed, however, is a new behavior after quitting and re-starting.
    Previously, no matter what month/day/week I was viewing when I quit iCal, it would open the next time to the current (month/day/week).  Now, it opens to whatever date(s) I was last viewing when I quit.
    This is highly annoying - 99% of the time, if I quit iCal while looking at (some date 6 months into the future), that is NOT the date I'm looking for when I re-launch.  It's much more consistent behavior to always re-open to the current date, in whatever view (month/day/week) I previously used.  So if today I launch iCal and I'm thinking about adding an event a month in the future, I open iCal, change to month view if needed, and go forward one month.  This is the way iCal always worked previously.  Instead, the version in Lion might leave me on any random month, depending on what I was doing when I closed the program the last time, and so I have to figure out "what month/week am I looking at?" before I know how to navigate.  Very irritating.  (As is the move of the forward/back buttons away from the month/day/week buttons, necessitating that I move the cursor to two different areas of the screen in order to navigate.  Whose idea was THAT?)
    I haven't found a preference to resolve this bizarre behavior change.  Can anyone help?

    Hi,
    I don't know of a preference, but have you used ⌘-T in iCal?
    Best wishes
    John M

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • Can I make a checkbox populate the current date?

    I've been asked to make a form that has quite a few checkboxes.  These checkboxes also need to be marked with a date when checked off.
    Rather than have the person filling out the form type the date every time they check the box, they request that when the user clicks the checkbox that a current date show next to the checkbox.
    I don't know if this can be done with a current date stamp or with having a text box that populates with the current date, etc.
    The forms are also going to be used throughout multiple days, so I can't just call on a "current date" and show/hide that text box like I had originally thought to do.
    I'm also really green to scripting so any help or guidance in the right direction would be much appreciated.
    Thank you.

    The following Mouse Up script for a check box will set the associated text field to the current data when it's selected, and blank the field when not:
    // Mouse Up script for check box
    (function () {
        // Get a reference to the text field
        var f = getField("text1");
        // Set the value of the text field
        if (event.target.value !== "Off") {
            f.value = util.printd("mm/dd/yyyy", new Date());
        } else {
            f.value = "";
    Replace "text1" with the name of the associated text field.

  • Goods Receipt in the Current Date however Goods Issue in the previous date.

    Dear Experts,
    I am doing a GR through MB1C (Movement Type 561) in the Current Date (Both Posting and Document Date are current) for a Particular batch of Material. However when I am trying to create a sales order->Delivery and PGI in the past date the system is allowing me to do so. What could be the issue ?
    Example : On 23-02-2010 Goods Receipt of Material "A" for 50 Tons for Batch "B100" done through MB1C Movement Type 561.
                     Stock in System as on Date 23-02-2010 in MMBE is showing 50 Tons of Material "A", Batch "B100".
                     A Sales Order is created for 22-02-2010 for the same Matrial, qty, batch and PGI is done on 22-02-2010.

    Hi,
    Issue is that previous period is not closed that is why system allow to create delivery in back date.
    Kapil

  • How to get the "current date" in the BEx?

    Hi all,
    I need to get the "current date" in my Bex report in order to make a comparison. I know there is a "How to" which shows how to get the current date via a User Exit, but I didn't find it. Could you please help me?
    Thanks

    1. Create a  New Formula in Key Figures structure
    2. Give tech name and description and Select "New variable" option
    3. Next screen will launch Variable Wizard -> create a new variable with replacement path as processing type
    4. in next screene  select the date characteristic that represents the first date to use in the calculation (From Date)
    5. In the next  screen select Key in the Replace Variable with field. Leave all the other options as they are
    6. In the next Currencies and Units screen select Date as the Dimension ID.
    6. Save variable
    repeate the Above steps to create another variable (To Date)
    and now you can use these two new replacement path variables in your new formula.
    Dev

  • How to get the current date in a workflow

    Hey,
    Can anyone tell me how to get the current date while in a workflow?
    Thanks in advance.

    Here is how we did it, hope it helps
    <defvar name='locCalendar'>
    <new class='java.util.GregorianCalendar'/>
    </defvar>
    <defvar name='dateFormat'>
    <new class='java.text.SimpleDateFormat'>
              <s>MM/dd/yyyy</s>
         </new>
    </defvar>
    <defvar name='formatedDate'>
         <invoke name='getTime'>
    <ref>locCalendar</ref>
    </invoke>
    </defvar>
    <invoke name='format'>
    <ref>dateFormat</ref>
    <ref>formatedDate</ref>
    </invoke>

  • How to get the current date ? in the form of dd/mm/yyyy?

    Hi all,
    As getDate( ), getMonth( ), and getYear( ) is depricated, how to get the current date or System date, month and year ? please help ??
    Regards
    Ashvini

    HI,
    Than u for the reply. But i am getting one error.
    as u said, I tried to do so.........
    but, i am getting one error.
    code
    Calendar cald=(Calendar.getInstance.getTime());
    out.println(cald);
    error message
    validate$jsp.java:86: Attempt to reference method getInstance in class java.util.Calendar as an instance variable.
    Calendar cald=(Calendar.getInstance.getTime());
    ^
    1 error
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    Pls help
    Regards,
    Ashvini

  • How to get the current data and time of SCOM server via SCOM SDK (API) calls?

    Hi,
    I need to read the current date and time of SCOM server via SOM SDK.
    Is there a class in SDK that provides this info ?
    Thanks,
    satheesh

    To get time and date of Alerts of SCOM, You can use following command let "get-scomalert"
    Also, You can refer below links
    http://blog.tyang.org/2013/02/21/using-scom-2012-sdk-to-retrieve-resource-pools-information/
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question, please click "Mark As Answer"
    Mai Ali | My blog: Technical

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

  • How can I set the date field to auto populate the current date?

    I have many forms to create where the current date dictates a specific change in options or conditions for the form filler to follow. I cannot see any way to handle that issue. Is it possible to simply set the current date as a default?
    jcytrny

    Sorry, we currently do not support having today's date show up in a date field by default
    Randy

Maybe you are looking for

  • Basic Question from a new guy

    Earlier question by me brought a response from Priya (thanks Priya) that I should post the results of querying my lsnrctl settings. How? I can run the query from DOS and get a pretty impressive output, but how do I save the output and then incorporte

  • Good quality, inexpensive keyboard to use with Logic

    Hey everyone, I'm a guitarist, but have more and more been utilizing my MIDI keyboard for synth/piano parts in my music. The MIDI keyboard is getting becoming a little small for my required use and I was wondering if anyone had advice on what keyboar

  • Cannot select iTunes Audio Track 2 / Dolby Digital

    Hello, I have a sound card (from Maplin, CMI-8738) with digital optical output configured to use SPDIF output and connected to a Denon Surround Receiver. The sound card is outputting dolby digital fine, when I play a test Dolby Digital encoded file o

  • Subject line colour change

    Hi all, Today for the first time half my incoming mail has a subject heading colour of Gold & the other half the normal Black. Has anyone know why this should have happened & how I correct it please. Barney

  • How to remove the default exit option on MIDP1.0 on Nokia devices?

    My application Astral effects displays visuals. It can not use any commands, because they cause conflicts with the visuals. Events from soft keys are handled through the keypressed method instead. I have made one Nokia version and one version for all