Newbie: how to create a dynamic select list of the current date + 5 years

Hi - I'm a JSP newbie (coming from a PHP background), and am trying to create a select list that contains the current year, plus 5 years. So, the list when generated (today), would display:
2007
2008
2009
2010
2011
2012
Obviously, the code would need to generate inside the option tags, as well as in the value property of the option tag.

function addit(){
          var val = 2012; //you can take this from js date object and strip it off
          for (var i=2007; i <= val;++i){
               addOption(document.getElementById("mycombo"), i, i);
function addOption(selectbox,text,value)
     var optn = document.createElement("OPTION");
     optn.text = text;
     optn.value = value;
     selectbox.options.add(optn);
}without hardcoding:
function addit(){
          var dd = new Date();
          var yearnow = dd.getFullYear();
          for (var i=yearnow; i <= yearnow + 5 ;++i){
               addOption(document.getElementById("mycombo"), 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="mycombo">
<option> Select year</option>
</select>
</form>
</body>
Message was edited by:
skp71
Message was edited by:
skp71

Similar Messages

  • Acrobat 9 - how do you create a dynamic stamp to include the current date (java script)

    I have seen my question multiple places and times but the resolutions provided have not worked for me.
    I am running Acrobat 9 Pro, cannot run X or XI due to the use of ProSystem fx Engagement.
    I want to create what I thought would be a simple stamp. My initials and the current date. i.e. "crm 01/10/13".
    Simple right? I created a PDF of my initials. Now I just need the text field with the proper Java Script to insert the date, correct?
    I have tried opening "Dynamic.pdf" and copying and pasting the text field that includes the Java Script:
    " event.value = (new Date()).toString(); AFDate_FormatEx("h:MM tt, mmm dd, yyyy"); "
    The date does not update, it stays static.
    I have manually entered the Java Script.
    I have edited the Java Script to remove the "Ex".
    I have edited the Java Script to revise the "yyyy" to "yy".
    I have edited the Java Script to remove the " h:MM tt, " trying different formats to get "dd/mm/yy".
    I have selected "Use single-key accelerators to access tools" in Preferences/General.
    I have tried PDF files, PNG files. I have created the image files from Word and Excel.
    I am at my wits' end. Can someone PLEASE assist me to resolve what should be a simple issue (I hope).
    Thank you in advance.

    Thank you for your response.
    Your script works well, but I still have the same issue.  The date is remaining static to the system date when the stamp is created.  My initial idea was to create a pdf of my initials "crm" and then add the text field with the java script for the date behind my initials.  "crm" + (TEXT FIELD with JS).  I wanted 3 stamps, red, blue and green.  The colors correspond to specific processes in our workflow.
    Your script adds my initials as well as the date.
    My machine is running Windows 7.
    My stamps are located:
    C://Documents/Acrobat Stamps/...
    Acrobat templates:
    C://Program Files (x86)/Adobe/Acrobat 9.0/Acrobat/plug_ins/Annotations/Stamps/ENU/...
    I have no problem creating stamps, just a stamp that will use the current system date.  I HATE using the typewriter for my initials and the date.  I guess I can stamp my initials and then type the date...but what is the point?
    Do you have any further thoughts or suggestions?
    Thank you very much.
    crm 01/11/13 

  • How to create a dynamic entry list for an input field in VC(ce 7.1)

    Hello all,
    I have an Input field, i need to create a Dynamic Entry List for it in VC(ce 7.1).
    How can this be done.
    Thanks in Advance.
    Thanks and Regards,
    Santhosh Guptha N

    Hi Santhosh,
    You can define Dynamic entry list for Drop down list and combo box but not for input field.
    [Refer this|http://help.sap.com/saphelp_nwce10/helpdata/en/2a/28249060dd4dbc872f6266f4557364/frameset.htm] for defining entry list.
    Let me know if it helped.
    Regards,
    Dharmi

  • Creating a dynamic Selection List based on a View Object

    Hello,
    I'm new to JDeveloper and I would like to create a JSP Page with dynamic Selection List based on a runtime query or based on a view object (BC4J). The selection made by an user should serve another dynamic query with the necessary parameters that I built using createViewObjectFromQueryStmt(). By now I tried this using the InputSelectLOV from the Component Palette in JDeveloper. But without success. By the way: the selection list is not very large (5 values), so it's not necessary to have a form finding the desired value.
    Maybe someone had experience about creating this already. Please give me a tip or a little example.
    Thanks.

    http://otn.oracle.com/products/jdev/howtos/jsp/renderers.html

  • How to create Exchange dynamic distribution list using multivalue extension custom attribute

    I am trying to create a dynamic distribution list using an ExtensionCustomAttribute.  I am in hybrid mode with Exchange 2013.  The syntax I have is this: 
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {(ExtensionCustomAttribute2 -eq 'NH')} 
    This works correctly on-prem.  But hosted always results in an empty list.  I can see in dirsync the attribute is in the hosted environment, but for whatever reason, the distribution group gets created but always come up null.
    If I create a group looking at the single valued attributes, such as CustomAttribute6 -eq 'Y', it works correctly on-prem and hosted.  
    If anyone has any suggestions I would appreciate it.

    I don't think I provided enough information about the problem.  Let me add some and see if it makes sense.
    I have an Exchange 2013 on-premise configured in hybrid mode with Office365.  For testing purposes, I have 2 users, Joe and Steve, one with the mailbox on-prem, and the other with the mailbox in the cloud.  Each of them has CustomAttribute6 = 'Y'
    and ExtensionCustomAttribute2 = 'NH'. Dirsync shows these users and these attributes are synced between on-prem and cloud.
    Using on-prem Exchange powershell, I run the following command:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them as follows:
    $DDG = Get-DynamicDistributionGroup DG_NH
    Get-Recipient -RecipientPreviewFilter $DDG.RecipientFilter | FT alias
    So I then delete this DG, and recreate it this time looking at the multi-value attribute ExtensionCustomAttribute2, as follows:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    Replaying the query above, I can see this also works fine and finds my two users.
    Next I open a new powershell and connect to Office 365 and repeat the process there.
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (CustomAttribute6 -eq 'Y')} 
    This correctly finds the 2 users when I query for them.
    And then delete the group and recreate it using the multi-value attribute:
    New-DynamicDistributionGroup -Name "DG_NH" -RecipientFilter {((RecipientType -eq UserMailBox) -or (RecipientType -eq MailUser) -and (ExtensionCustomAttribute2 -eq 'NH')} 
    When I run the query this time it produces no result.  Every test I try results in an empty group if I am using a multi-valued attribute in the search criteria in the cloud.  If I use single valued attribute, it works fine.
    I really need to be able to get multi-valued DDG's working in the cloud.  If anyone has done this and has any suggestions, I would appreciate seeing what you did.  And if this is the wrong forum to port this, if you can point me to a more suitable
    forum I will report there.
    Thanks,
    Richard

  • How to create a Virtual part list for the particular assembly.

    Dear Gurus,
                        For our single purchasing order of particular assembly, we have multiple suppliers who can contribute in that Assembly. For example The purchasing order of Assembly X is given to supplier A and in that some part should be also ordered which should be delivered to supplier A from supplier B. In this situation, I want to create a virtual part list of the assembly which can be used to order both of this supplier seperately. So I do not forget to make purchasing order to the supplier B.
                       Thanks in advance.
    Regards
    Mayur

    Dear Mayur,
    One of option for you is: using document draft as the template for the part list of supplier B.  Then create user alert whenever the supplier A need to be ordered.
    Thanks,
    Gordon

  • Can I create a dynamic (selectable) list

    Hi, I'm in the process of building a wedding website and within that I'd like to get a page dedicated to an alternative gift list. The list takes the form of Bricks & Mortar and has items (bricks, concrete, windows etc.) to build a new extension.
    Is there a way that I can build a page with the individual items listed alongside a box in which someone can enter a quantity of item/s to buy. Then if there were say 10 of that item it would show how many were left to buy after the purchase was completed?
    For example: 1000 Bricks x 10 Someone choses to buy 1 batch of 1000 bricks leaving 9 batches left on te list.
    Is this beyond the power of iWeb?

    Hi, I'm in the process of building a wedding website and within that I'd like to get a page dedicated to an alternative gift list. The list takes the form of Bricks & Mortar and has items (bricks, concrete, windows etc.) to build a new extension.
    Is there a way that I can build a page with the individual items listed alongside a box in which someone can enter a quantity of item/s to buy. Then if there were say 10 of that item it would show how many were left to buy after the purchase was completed?
    For example: 1000 Bricks x 10 Someone choses to buy 1 batch of 1000 bricks leaving 9 batches left on te list.
    Is this beyond the power of iWeb?

  • Dynamic Select List based on TextField data

    Hi,
    I like to dynamically display the select list based on the value in the textfield, the data in the textfield is of character type.
    Thanks

    Hello,
    Well as you now know HTML based select lists don't work like that, that widget is called a combo box and there will be built in combo boxes in APEX 3.0, it's a fairly complex dhtml widget.
    What you might want to do is provide a text item next to your select box and an Add New Value Option in your select list.
    Carl

  • How to create an dynamic internal table with the structure of a ddic table

    Hi all,
    I want to fill ddic-tables (which I already created) in my abap dictionary with data out of CSV-files (which are located on the CRM-Server).  The ddic tables have different amount of fields.
    I started with creating a table which contains the name of the tables and the path to the matching CSV-file.
    At the beginning I'm filling an internal table with part of this data (the name of the ddic-tables) - after that I am looping at this internal table.
    LOOP AT lt_struc ASSIGNING <lfs_struc>.
         LOOP AT lv_itab1 INTO lv_wa1 WHERE ztab_name = <lfs_struc>.
         lv_feld = lv_wa1-zdat_name.
        ENDLOOP.
        CONCATENATE 'C:\-tmp\Exportierte Tabellen\' lv_feld INTO lv_pfad.
        Do.
        OPEN DATASET lv_pfad FOR INPUT IN TEXT MODE ENCODING NON-UNICODE IGNORING CONVERSION ERRORS.
        READ DATASET lv_pfad INTO lv_rec.
        IF sy-subrc NE 0.
          EXIT.
        ENDIF.
        enddo.
        REPLACE ALL OCCURRENCES OF '"' IN lv_rec WITH ''.
        SPLIT lv_rec AT ';' INTO TABLE lt_str_values.
        INSERT into (<lfs_struc>) values lr_str_value.
        CLOSE DATASET lv_pfad.
    endloop.
    This is not the whole code, but it's working until
    SPLIT lv_rec AT ';' INTO TABLE lt_str_values.
    I want to split all the data of lv_rec into an internal table which has the structure of the current ddic-table, but I didn't find out how to do give the internal table the structure of the ddic-table. In the code I used an internal tyble type string but I should be the structure of the matching tabel.
    If I try to create an internal table by using a fiel symbol, I am told, that the data types are not matching.
    Has anyone an idea?

    Hi Mayari,
    though you were successfull with
    METHOD cl_alv_table_create=>create_dynamic_table
    I must warn you not to use it. The reason is that the number of tables created is limited, the method uses GENERATE SUBROUTINE statement and this triggers an unwanted database commit.
    If you know the DDIC structure, it is (starting with ECC6.0) much easier:
    field-symbols:
      <table> type standard table.
    data:
      lr_data type ref to data.
    Create data lr_data type table of (<DDIC structure>).
    assign lr_data->* to <table>.
    The split code can be simplified gaining speed loosing complexity not loosing functionality.
    field-symbols:<fs_s> type any.
    field-symbols:<fs_t> type any.
    SPLIT lv_rec AT ';' INTO table it_string.
    loop at it_string assigning <fs_s>.
      assign component sy-tabix of wa_string to <fs_t>.
    if sy-subrc = 0.
      <fs_t> = <fs_s>.
    endif.
    at last.
      append <fs_itwa3> to <ft_itab3>.
    endat.
    endloop.
    Though it may work as Keshav.T suggested, there is no need to do that way.     
    Regards,
    Clemens

  • How to create a JSP dropdown list in the latest Early release

    Hello:
    this is probably an easy question. I am trying to create a dropdown list in a JSP form from a data control like "employee id". just dragging the data control attribute does not seem to have any effect in showing the drop down list when the JSP page is run.
    What is the missing factor?
    Thanks in advance for the help.

    Please ask this in the JHeadstart forum
    Timo

  • Newbie:how to create a page with 4 textfields and send data to MySql DB

    Dear all,
    i have created a page called page1 with 1 submit button named 'submitButton' and 4 textfields named:
    'date'
    'item'
    'contact'
    'phone'
    I have created a MySql DB table with the schema named 'association' and table named todolist3. Fields created in the table are :
    'Date' - >INTEGER->Primary
    'Item' ->VARCHAR(100)
    'Contact' ->VARCHAR(45)
    'Phone_contact' ->INTEGER
    what i want to do is to send the data from the 4 textfields to the database when i click the submit button. Below is the code i out in submit button. please kindly help as i have tested different ways but none of them works. thank you!!!
    public String submitButton_action() {
    try {
    if ( todolist3DataProvider.canAppendRow() )
    String item1=(String)item.getText();
    String contact1=(String)contact.getText();
    Integer phone1=(Integer)phone.getText();
    Integer date1=(Integer)date.getText();
    RowKey rowKey = todolist3DataProvider.appendRow();
    todolist3DataProvider.setCursorRow(rowKey);
    todolist3DataProvider.setValue("todolist3.Date", date1);
    todolist3DataProvider.setValue("todolist3.Item",item1);
    todolist3DataProvider.setValue("todolist3.Contact",contact1);
    todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
    } else {
    error("submitButton_action() -- cannot append todolist3 record");
    } catch (Exception e) {
    error("Page1::submitButton_action-- something's wrong trying to append todolist3 record");
    return null;
    }

    Hi,
    I think that you have forgotten to commit changes. Modify your code to look like this:
    RowKey rowKey = todolist3DataProvider.appendRow();
    todolist3DataProvider.setCursorRow(rowKey);
    todolist3DataProvider.setValue("todolist3.Date", date1);
    todolist3DataProvider.setValue("todolist3.Item",item1);
    todolist3DataProvider.setValue("todolist3.Contact",contact1);
    todolist3DataProvider.setValue("todolist3.Phone_contact",phone1);
    // commit your changes !!!
    todolist3DataProvider.commitChanges();
    } else {
    // ....best regards
    Grzegorz

  • Select List with the current value

    Hi,
    I have a Page suppose Page1 with 2 region.
    Region1 is having SEARCH button (target page 1 itself) and a SELECT LIST called Deptno (10,20,30,40)
    Region2 is just a simple employee report based on Deptno (where deptno = :p1_deptno)
    Now when I suppose select deptno 30 and press SEARCH button, report is not displayed and also Dept select list current value becomes the first one in the list i.e 10.
    My question is after submitting the same page 1 using SEARCH button, how can I display the selected value (dept 30) in the select list.
    Note:- If I am using Select List with Submit then it's working fine and also displaying the current value (30) in the list, But I am looking for using SEARCH button.
    Thanks,
    Deepak
    Edited by: Deepak_J on Aug 6, 2009 2:14 PM

    Hi,
    Then the value that is selected in the list will not be submitted, so it will not be saved. You need a button that submits the page.
    Andy

  • How to create a latch that can latch the input data for 50ms?

    Now I have some data come from the sensor. I want to latch this data for 50 ms and then reset it to 0. Does anybody do this before? Thank you

    Now I am using the "two button dialog" to create a dialog box. After the dialog box pop up, I choose "yes" the "two button dialog" will output a "True". My problem is that this "True" disapear too fast. My while loop frequency is only 20Hz. And I want to send this "True" value to somewhere. However the two "button dialog" will clear this "True" after 10ms?. So I always got a "false" value. How to "Freeze" this dialog box output value for at least 50ms? How to create a latch to hold this value?
    Attachments:
    Two_button_Dialog.bmp ‏1132 KB

  • How to sort news articles from Oldest(from the current date) to newest?

    I have a list of news announcements from the month of "Jan 2015" to "Dec 2015". For example each month having a one event, so totally 12 events. But I need to display the latest news articles from current date of latest upcoming news at the top(i.e. May 2015) to farthest at the bottom(i.e. Dec 2015)

    Try with sort!
    {module_announcement sort="datereverse"} or {module_announcement sortType="datereverse"}. I'm not sure what syntax we use with the new render engine.
    With the old syntax it would be {module_announcement,filter,id,noTemplate,effect,targetFrame,reserved,reserved,reserved,r eserved,sort}

  • How to create a dynamically growing list in SAPUI5?

    Hi,
    I want to create a growing list in SAPUI5 like this http://help.sap-ag.de/saphelp_uiaddon10/helpdata/en/91/64ba7047b74a25a19baf9c5bb986ae/content.htm
    However, I want to hit a url to fetch data every time[10 rows on every load]. My JSON data contains more than 200 rows and I do not want to load everything when the app starts. Can you help me with your code for achieving this?
    Thanks
    Senthil Kumar

    Hi,
    Like I said, if it's an OData service call, then data is loaded from the server, and the amount of retrieved data specified by the threshold.
    if it is a simple REST / JSON service, then all data is loaded during the initial service call, but the list only shows (and grows) by what's specified at the threshold parameter.
    In other words, the real benefit of the growing list is when using OData services

Maybe you are looking for