Javascript hel - how to limit date selection ?

I  use the following javascript to validate a start and end date, and radio buttons on my form. What I need to do is limit the date selection to 30 days only. Anything more should display an error. So if I enter starting date of 1/1/2009 and ending date of 2/28/2009, then I should get a popup error. How can I do this with my exisintg code :
<Script language="JavaScript">
  function validateForm()
if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value == "")
    alert('Start Date and End Date cannot be blank.');
    indexForm.startDate.focus();
    return(false);
if(document.indexForm.startDate.value > document.indexForm.endDate.value)
    alert('End Date cannot be less than Start Date.');
    indexForm.endDate.focus();
    return(false);
if(document.indexForm.startDate.value !== "" && document.indexForm.endDate.value == "")
    alert('End Date cannot be blank.');
    indexForm.endDate.focus();
    return(false);
if(document.indexForm.startDate.value == "" && document.indexForm.endDate.value !== "")
    alert('Start Date cannot be blank.');
    indexForm.startDate.focus();
    return(false);
myOption = -1;
    for (i=indexForm.region_code.length-1; i > -1; i--) {
    if (indexForm.region_code[i].checked) {
    myOption = i; i = -1;
    if (myOption == -1) {
    alert("Please select a region.");
     return(false);
myOption = -1;
    for (i=indexForm.reportName.length-1; i > -1; i--) {
   if (indexForm.reportName[i].checked) {
   myOption = i; i = -1;
    if (myOption == -1) {
   alert("Please select a report.");
     return(false);
return(true);
</Script>

Step 1.  Get rid of anything that can be done with a cfinput tag and the built in js that comes with it.
Step 2 - js is reading strings, not dates from your text boxes.  Convert these to dates before you start comparing the values to each other.

Similar Messages

  • How to populate data selection in infopackage from spreadsheet

    Hello,
    I have to load data for thousands of missing CRM orders into BI via the BI-CRM extractor 0CRM_SALES_ORDER_I . We have list of those missing orders in a spreadsheet.
    How do I  populate these order numbers into the data selection tab of the data source?
    I tried adding multiple orders at a time..butit doesnt load any data. On the other hand, when I was loading a single order at a time, it does load all the data.
    Loading thousands of them manually will be a hectic job
    Also, I cannot use ranges as they are not at all in range
    Can somebody provide a workaround which hopefully will not involve any transports
    Thanks!

    This seems to be really cool! and I am able to open the editor in production too...
    The only problem is I really have not ides how we can pass the parameters here..how we get the program to look up a spreadsheet and populate those records
    Thanks for your input..it will be really helpful if you can provide me anymore information you have on htis..in the meanwhile, I will be doing some trial and error myself
    thanks!

  • How to change date selections at Infopackage data selections in production sys

    Hi All ,
    we are loading data into Infocube from datasource ,one process chain for delta init with data transfor  ,which has data selections at infopackage say 06.2014 and other process chain for delta which has same selections at infopackage . Now I want change this data selections  at Infopackage level .
    I Have tried to change these dates in data selections at infopackage level , tho I have changed and saved to future date at delta initial with data transfor ,it's keep coming back to 06.2014. Of course data selection at delta Infopackage level is faded .
    I Want to set future date with delta int with disturbing delta loads . How to do it please .
    regards
    hari

    Hi Ram,
    We will  load delta Intial with data transfer every weekend , and we run delta everyday , because we do delta init with data transfer with selections say ( 01.20011 to 12.2003 ) every weekend , hope I need to create new delta infopack  with new data selections say ( 01.2004 to 12.9999) only  to get update data in Infocube.
    Please correct me if I am wrong .
    Regards
    hari

  • Need limit data selection to GL_Period in FDM integration script

    Greetings!
    I am trying to modify an FDM Integration script to limit the data selection to a specific GL period name. The FDM function passes 4 parameters of which one is dblPerKey. My understanding is that this parameter contains the end-date of the requested GL Period and thatthe element is a datetime data type. I have tried several incantations of VB Script to create a period name in MON-YY format and all seem to fail with no data returned. What I am not understanding is what is the content of dblPerKey and can I use it to derive a GL period name? If not, I am open to any and all suggestions.
    My deepest appreciation and thanks for any and all suggestions you may send my way.
    Tom

    Hi Tom
    If you haven't already I'd try posting this in the FDM forum as I think you are more likely to get an answer there.
    Performance Management Applications > Financial Data Management
    Regards
    Stuart

  • How to edit data selection(Date) for an Init Delta Infopackage

    Hi Experts,
    We have a Process Chain which contains an Delta Infopackage.
    This Delta Infopackage has a Data Selection (Date) condition which is till 12/2008. As well the same date selection is present in the init method as 12/2008.
    Also we need to change the date selection in the data sources in R/3 side.
    *Is there a way to edit the Init condition so that we can pull 2009 data without deleting the present Init and recreating a new Init?????? please suggest us with the procedure for the same.
    Also could you tell us the impact of changing the date selection in BW and R/3 side??
    Appreciate your response.
    Thanks
    Vivek Das Gupta

    Hi Ajeet,
    I followed the steps you mentioned.
    I created a new infopackage, gave the condition (01/2009 to 12/2999) and did a Init without Data transfer.
    1. Now if we do a Delta load, will the loading be based on both Init Selections (01/2004 to 12/2008 and 01/2009 to 12/2999)  or will it take the recent Init condition only(01/2009 to 12/2999)??
    2. After doing the New Init(01/2009 to 12/2999), the Delta InfoPackage still shows the old Data Selection (01/2004 to 12/2008) In Selection Tab of IP, do we need to change the Date Selection  as 01/2009 to 12/2999?
    3. Where can we the Data selection in R/3 (TCODE)??
    Vivek Das Gupta

  • How to extend data selection to the existing delta update without disturbin

    Is there any way to extend data selection to the existing delta update with out disturbing the delta mechanism? I mean, is there anyway to add new delta init for the new data selection to the existing delta update without disturbing?

    the scenario is we have existing delta, let's say, for the 2 company codes 0001 and 0002. I want to extract delta for the company code 0003 without disturbing the existing delta mechanism. I mean to say I want to extend the data selection for the existing delta from 2 comp codes (0001, 0002) to 3 company codes (0001,0002 & 0003) without disturbing the delta mechanism.

  • How to limit data range in a Line chart with Time Refresh Control

    Hi All,
    I have a Line chart with Time Refresh Control and I would like to make some constraints to this navigation.
    For example, I would like to limit the user to navigate in a data range of 8 hours.
    Is this posible?
    Thanks in advance

    Hi Pedro,
    as far as I know, this is not possible using the time controls on an iChart. However, you may have some success by using your own time controls which call JavaScript methods exposed by the applet.
    For example, you could begin by hiding the time and calendar buttons on an iChart, and creating some buttons of your own. For instance, to set the start date of a query (and thus the start date of the iChart using the query), you can use the following:
    document.getElementById("appletID").getQueryObject().setStartDate(<date string>);
    Using code like the above (look into the xMII script assistant and documentation), you should be able to build time controls which satisfy your requirements. The exact format of <date string> in the sample above will depend on the date format defined in the query template this script calls.
    Hope this helps,
    Sascha

  • How to avoid data selection inside the loop?

    Hello Experts,
    I am working on one performance item and I have already applied some changes to the original version.
    Now, If I compare my new program with old program, I have good improvement in performance. I am checking if I can do anything on statements that are top on the below list. I think 40% for Modify statement is acceptable after my research (Below run is updating around 20M records which is real time volume for this application).
    As we can see 34% of run time to going for one SELECT query on custom table. Take a look at below high level flow of my program to understand above select query.
    1. Select data from ZABC
    2. Select data from Variant Table (Var1, Var2, Var3 etc.., 12 in real time)
    3. Loop Variant Table
    4. Select data from X, Y, Z table for Var<n>.
    5. Populate final internal table from ZABC, X, Y and Z table
    6. Modify ZTABLE with Final Internal table data
    7. End Loop on Variant Table
    As described in the flow of the program, ZABC table data is common for all the variants and need not to fetch multiple times. Hence I am doing it only once in my program. Below is that select query:
    select rrcty ryear rbukrs racct rcntr sum( amt1) as amt1  "Like I have 32 amount fields in original query
               from zabc
                into table i_zabc
                where ryear in r_year    " Two records in ranges with I and EQ
                and rvers = '001'
                and rrcty in r_rrcty        "Three records in ranges with I and EQ
                and rldnr = 'DT'
                group by rrcty ryear rbukrs racct rcntr
                order by rrcty ryear rbukrs racct rcntr.
    ZABC table is again having huge volume of data and we are fetching millions of records with above query. That is primary reason to take long time. May be that is okay as I am already using Indexes of this table. But, I am not comfortable with it as it can reach max. memory point and through run time error. Fetch Cursor is one reliable option that I can see here, but with that, I should move ZABC selection inside the variant loop which can cause fetching ZABC data 12 times (Let me know If I am missing anything here).
    Now, third statement in my trace results, with 10% of overall time is this:
    loop at i_abc assigning <fs_abc>. 
    loop at i_table assigning <fs_table> where low <= <fs_abc>-racct and high >= <fs_abc>-racct. 
    endloop. 
    endloop. 
    6 million executions with this complex WHERE condition is causing this statement to get 3rd position in trace results. I tried below two options which are, I think, taking even more time - (I am still monitoring these options)
    1) Removed WHERE condition on LOW, HIGH and applied filter inside the loop.
    2) Removed WHERE condition on HIGH only and applied filter inside the loop.
    Any suggestions on how to proceed with ZABC selection and I_TABLE loop.
    Let me know if you have any questions on above compose.

    Since I looked at this case before, let me try some quick suggestions:
    Is table ZABC related to table X, Y and/or Z and can the selection be limited by applying those 12 selection variants?
    If yes, try a join select involving these tables that could make your step 1 obsolete and replace steps 4 and 5.
    This might also get rid of the "loop inside loop" problem. Generally, make sure that the inner table is declared as a sorted table with a key that consists of the fields as used in the WHERE-condition of the inner loop. Use secondary keys for internal tables if your ABAP release permits and the task at hand warrants it.
    Finally, look at PACKAGE SIZE option for the (join) select to reduce memory consumption.
    Thomas

  • How to limit the selection of Ship To Party

    I have a Biz Case:
    "A" user have 2 Ship to party "B" and "C" in the customer master data, when I create a OR order, I found I can use "D" user as the ship to party(of course, A is sold to party).
    So I want to impl this function:
    if sold to party is A user in a sales order, ship to party can only be B or C, how to config it?
    thanks...........

    Hi Zhang,
    You are correct. You can enter ship-to D even though it is not maintained. As described in OSS note 380507 the
    system will accept every ship-to party which you select manually. The ship-to party doesn't have to be associated
    with the sold-to party in the customer master data. It is only required that the selected ship-to party is maintained in the           
    same sales area.                                                                               
    To get the system to work differently a modification is needed.                     
    Some tips for a modification:                                                        
    - table TPACHECK (which checks should be performed)                          
    - function modules SD_PARTNER_SINGLE_MODIFY                                  
      -> SD_PARTNER_CHECK_BEFORE (error messages)                                
      -> SD_PARTNER_CHECK_AFTER (info and warning messages)                                                                               
    Or another option you may consider userexit in MV45AFZZ (maybe        
    userexit_save_document or userexit_save_document_prepare).
    Hope this helps.
    Best regards,
    Ian

  • How to limit date fields between 2 values

    Hi I have two date fields and I can use min and max to limit them between two values. But what I wanna do is make it so that the user can only insert values before June 30th each year. So if a value is over that it gives an error. Right now I can do it but would have to change the year each year because I specify it as
    Min june 30th 2011
    Max june 30th 2012
    I want this but so I don't have to change it to 2013 in a year.
    Thanks and best regards

    The validator should only allow dates in the range between June 30th this year and July 1st of next year. But with next year defined as current year + 1 year, not as a straight number which would have to be changed every year.
    Does this make sense?
    Here is a little background I have a vacations table and in it fields user, start, end, and ID. Now Start and End are the date fields. I have this query which gives a number of vacation days a user has spent excluding saturday and sunday. Now the problem in this query is that when the user inserts his vacation dates he can insert them for 10 years from now which messes with the query. So I was thinking if there was a way to limit the user to only be able to insert dates for the given business year which in my company (for some reason) goes from July 1st. That is the cut off date.
    In other words in my company you have to use your vacation days by july 1st. Then you get the vacation days for next year which you can again use, until July 1st of next year. If you haven't used last year's vacation days by then you lose them. I just want to somehow incorporate this into the application.
    Here is the sql query (and props to user Pollywog)
    WITH t AS (  SELECT id,
                        MAX (strt) strt,
                        MAX (finish) finish,
                        SUM (dys) days_off
                   FROM (SELECT id,
                                strt,
                                finish,
                                CASE
                                   WHEN TO_CHAR (dy, 'day') LIKE 'saturday%' THEN 0
                                   WHEN TO_CHAR (dy, 'day') LIKE 'sunday%' THEN 0
                                   ELSE 1
                                END
                                   dys
                           FROM vacations
                         MODEL
                            PARTITION BY (ID id)
                            DIMENSION BY (0 d)
                            MEASURES (POCETAK strt, KRAJ finish, POCETAK dy)
                            RULES
                               (dy [FOR d FROM 1 TO finish[0] - strt[0] INCREMENT 1] =
                                     (NVL (dy[CV () - 1], dy[CV ()]) + 1)))
               GROUP BY id
               ORDER BY id)
    SELECT t.id,
           t.strt,
           t.finish,
           t.days_off,
           vacations.korisnik,
           SUM (
              CASE
                 WHEN finish < TO_DATE ('01/07/2011', 'dd/mm/yyyy') THEN days_off
                 ELSE 0
              END)
           OVER (PARTITION BY vacations.korisnik ORDER BY t.id)
              this_years_running_total,
           SUM (
              CASE
                 WHEN finish < TO_DATE ('01/07/2011', 'dd/mm/yyyy') THEN days_off
                 ELSE 0
              END)
           OVER (PARTITION BY vacations.korisnik)
              this_years_grand_total,
           SUM (
              CASE
                 WHEN finish >= TO_DATE ('01/07/2011', 'dd/mm/yyyy')
                 THEN
                    days_off
                 ELSE
                    0
              END)
           OVER (PARTITION BY vacations.korisnik ORDER BY t.id)
              next_years_running_total,
           SUM (
              CASE
                 WHEN finish >= TO_DATE ('01/07/2011', 'dd/mm/yyyy')
                 THEN
                    days_off
                 ELSE
                    0
              END)
           OVER (PARTITION BY vacations.korisnik)
              next_years_grand_total
      FROM t, vacations
    WHERE t.id = vacations.idEdited by: Dino2dy on Jun 6, 2011 5:44 AM

  • How to limit data for a dimension in any subject area?

    Hi folks,
    I do have a little problem, maybe you can help me:
    I have a large subject area for all my countries and product i sell there.
    now i want to have special subject areas for certain countries.
    that for i ducplucated my large subject area, went to the identity manager and there I set special Rights für the users: I chose my fact measure and put a data filter for it on the dimension country.countryname = Germany.
    I hope you can fallow me until here. ;-)
    Now I can build a query in answers and it works, within this subject area I only get data for Germany.
    BUT: when I'm on the criteria tab and try to create a filter on my countryname (from the dimension) it shows me all the countries I have.
    I think for the end users this is a litte bit confusing.
    So how do I limit the dimension in this subject area to a particular value?
    I would be very happy for help, cause then I could finish my development for today ;-)
    Kind regards,
    Sven

    Try this; @BMM Fact source properties->Content tab->WHERE clause section add the dimension country.countryname = 'Germany'.
    Also set the implicit fact on the subject area.
    Let us know how it works
    Edited by: Srini VEERAVALLI on Apr 8, 2013 7:12 AM

  • How to limit Data Packages/ Info IDoc in InfoPackage to 3 while executing

    Hi,
    In our system BW 3.5 We have couple of both BC Extractors and Generic extractors. All are working fine, but  with one generic extractor I got  problem like if I run the InfoPackage  of Full Load type. All 34 Data Packages are fludded at a same time( but with other InfoPackages only 3 Info Idocs are running at a time and new Info Idoc is starting only after completing old Info Idoc).
    So Please let me know how to control only three Info IDocs at a time than all Info IDocs at a time. because I am scraring on monitoring in SM66 and all dialog Processes are looking same time and executing all Data Packages in same time.
    I will assign points.
    Thanks,
    Kaveri

    HI Kaveri,
    http://help.sap.com/saphelp_nw2004s/helpdata/en/17/e0603801be792de10000009b38f842/frameset.htm
    just go through the above link....
    Hope it helps,
    Ajay

  • How to access data selected through a cascading pulldown menu?

    Hi,
    I'm having the hardest of times trying to get my cascading pulldown menu to do what I want. The problem being is that from the original menu selection the user is able to cascade 2 levels down so by the time he/she actually releases the mouse button the menu item that is selected is something like this:
    with "object" being the top level menu selection:
    object->color->blue
    or
    object->shape->triangle
    etc..
    So now the problem is that I need to be able to display on the front panel what the user selected WITHOUT making a string indicator in each case. I want to be able to have just one string indicator for each level of the pull down so one would display: shape or color and the other w
    ould display the actual color??? Please there has to be an easy way of doing this! I have looked through all the menu example and I can't find anything on cascading menus, Thanks in advance,
    Alex

    Hi,
    Either you misunderstood or I misunderstood your answer. After reading the LabVIEW manual it seems that the use of local variables will solve my problem. My question was basically how can I have 1 front panel display object display values that can be set in different places in the VI, so I think I can do it with local variables. I just need to put say 4 local vairables , each in a separate case statement and have them all point to one front panel indicator. Let me know if you think this is the correct way of doing it,
    Alex

  • HOW TO READ DATA SELECT TO_CHAR(TGL, 'DAY') AS TGL FROM TEMP_SELLOUT_MP_HY;

    this is my code
    SET SERVEROUTPUT ON
    DECLARE
    CURSOR CUR_SELLOUT_MP IS
    SELECT /*+ INDEX_JOIN(SO) */ TK.ID,
    TMP_SELLOUT_MP.TGL,
    TMP_SELLOUT_MP.TOTAL_PENJUALAN,
    TMP_SELLOUT_MP.LGE,
    TMP_SELLOUT_MP.NOKIA,
    TMP_SELLOUT_MP.SE,
    TMP_SELLOUT_MP.SS,
    TMP_SELLOUT_MP.LAINNYA,
    TMP_SELLOUT_MP.NAMA_TOKO,
    TMP_SELLOUT_MP.KOTA,
    TMP_SELLOUT_MP.NAMA_MP,
    TO_CHAR(TGL, 'Day')
    FROM REF_TOKO TK,
    TEMP_SELLOUT_MP_HY TMP_SELLOUT_MP,
    REF_SALES_OFFICER SO
    WHERE UPPER(TK.NAMA) = UPPER(TMP_SELLOUT_MP.NAMA_TOKO)
    AND UPPER(TMP_SELLOUT_MP.NAMA_MP) = UPPER(SO.NAMA)
    AND SO.SOF_TYPE = 'MOBILEPROMOTOR';
    CURSOR CUR_TGL IS
    SELECT DISTINCT(TO_CHAR(TGL, 'Day')) AS TANGGAL FROM TEMP_SELLOUT_MP_HY;
    V_A VARCHAR2(20);
    BEGIN
    FOR I IN CUR_TGL LOOP
    V_A := I.TANGGAL;
    IF V_A = 'Friday' THEN
    DBMS_OUTPUT.PUT_LINE(V_A);
    END IF;
    END LOOP;
    END;
    why dbms_output.put_line not show??
    this data from cursor CUR_TGL:
    Thursday
    Friday
    Wednesday
    Saturday
    Edited by: xoops on Mar 11, 2010 9:21 AM

    What happens when you use:
    SELECT DISTINCT(TO_CHAR(TGL, 'fmDay')) AS TANGGAL FROM TEMP_SELLOUT_MP_HY;Add 'fm' tyo the format, your match doesn't take the trailing space into account:
    SQL> select '#'||to_char(sysdate, 'Day')||'#'
      2  from   dual;
    '#'||TO_CHA
    #Thursday #
    SQL> select '#'||to_char(sysdate, 'fmDay')||'#'
      2  from   dual;
    '#'||TO_CHA
    #Thursday#Edited by: hoek on Mar 11, 2010 6:43 PM

  • Offline data with mobile service - How to limit data download

    Hi to all,
    I have to manage offline data with mobile service.
    I have a table with a lot of data but I would like to download data range by range,
    let say 100 records for time.
    Is it possible to do this with PullAsyn method?
    I noticed that I'm not able to use skip function at the query parameter in the PullAsync method.
    Infact if I try to use it in the query 
    await mytable.PullAsync("mykey",mytable.Where(r => r.userid == iUserId).Skip(iSkip).Take(iTake));
    I receive this error:
    Incremental pull query must not have skip or top specified
    Any help is appreciated.
    Thanks
    Daniele

    Right now, the implementation of PullAsync() in the .NET SDK, will always try to continue paging until the end. So this will download the initial range, but then continue on with everything after as well (updating skip until no more records are found)
    So you would be better off (probably) in letting the inc sync logic handle the paging for you. 
    To come up with an appropriate workaround, what issue are you running into letting inc sync fetch all the pages sequentially in the background?

Maybe you are looking for

  • Performance tuning & Securing MX 7 on IIS 6

    I never had much at all to do with Coldfusion and have just been asked to look into making some security and performance suggestions for a small Windows 2003/IIS 6 server farm using Coldfusion MX 7. This is what I was planning; Configure all IIS webs

  • HELP HELP HELP HELP HELP PLEEEEEEEEEEEEASE HELP !...

    HI >> my N95 8GB GOT BRICKED >> I've tried to change the phones original font with another font (arabic font) .. when I've restarted the phone .. everything is written in squars .. i mean there is no actual letters .. only squars .. after i enter my

  • Ovi Map not showing railway lines on N8 (UK map)

    Hi I've recently purchased a N8, and I was suprised to see the UK maps not showing the railway lines. However if I scoll across to Germany for example, the lines are clearly shown. They used to show up on my 5800 and show up on the Ovi maps website,

  • Distributed Cache Synchronization

    I'm trying to implement distributed cache synchronization via RMI but I find the documentation to be very limited on how to do this. I'm doing exactly what the documentation says and I end up with a CommunicationException when trying to connect to th

  • Graphics does not start unless I chmod a=rwx /run/user/0

    Hello, I boot Arch Linux 2014.04.01 x86_64 Live CD, do pacman -S xorg-server xorg-xinit i3 xf86-input-synaptics xf86-video-modesetting useradd someuser ; mkdir -p /home/someuser ; chown someuser:someuser /home/someuser su someuser ; cd /home/someuser