Page item (date picker)

I have added a date picker to my report . and in the report source I've added a where clause to filter the report as per the selected date(which is one of the columns in the table) but there is nothing shown.
where DATE =:P23_DATE
when I remove the where clause all the records appear and when I return it ..nothing there.
can someone help me?
Edited by: Beena-IT on May 4, 2013 7:19 AM

You have data, that's good. You've isolated the problem to what seems to be the WHERE clause, good. The WHERE clause is simple, good. So, it would seem DATE NOT = :P23_DATE for your query.
Remember -- or note, if you didn't know this -- page items are (always?, mostly) character strings. As Jeff intimates, if DATE is a date, you will get implicit date conversion in your WHERE clause. (BTW, isn't DATE a Reserved Word?) May I suggest trying "DATE = TO_DATE(:P23_DATE,'your date format here')" to make it an explicit conversion?
Also, I recommend running any query you are having a problem with in the APEX SQL Commands window. Then you can immediately see what APEX is returning for your query. It helps my debugging a lot.
Regards,
Howard

Similar Messages

  • How to pass the page item data from tabA to TabB of a discoverer report

    I have a discoverer repoort, it is master_detail (Dept-Emp) report
    TabA is a master worksheet, which has a page item Deptno
    (the data is from a customized query)
    TabB is detail report which has a Deptno as the page item
    which show the emp detail info on this deptno
    (the date is from another customized query).
    What I want to do is;
    When I change the Deptno in TabA, TabB should automatically change to the deptno of Tab A when I click TabB.
    How can I pass the page item deptno from TabA to page item of TabB?
    Thanks for your help

    Hi.
    You are absolutely right, you cannot create a link from Page Item.
    My Idea was (and I'm sorry taht I didn't mention it at the beginning) to create one link for each and every column in the report in the TabA.
    All these links would be exactly same and pass the Deptno to the TabB.
    So the end user can click wherever he wants (all cells on the worksheets have the link to the TabB) and he is always redirected to the TabB with the Department parameter seted to Deptno Page Item from TabA.
    As I already said before, it is not exactly what you expected, but it's probably the best you can get out of Plus.
    Jakub

  • Random page item data corruption

    I designed an APEX page for a service request processing application with several date page items. Our database is Oracle 10g. The application is in production and the users have reported that data in some date page items become corrupted randomly. For example, the user enters ’07/04/2011’ in the date page item “Planned Start Date” among other values and submits the page. The date somehow winds up ‘07/04/0011’ that is, year 11. (A corrupt date increases the risk that these transactions will not be processed in a timely manner and will negatively impact the level of customer service the user wishes to provide.)
    I have identified three possible areas that may hold the key to underlying cause: 1) page item edit mask, 2) page process(es), 3) DB column constraints. Inasmuch as this is a random problem and has affected a handful of rows it may not be possible to trace the logic as the pages are processed. Has anyone encountered this problem and can suggest a possible remedy? For the sake of clarity I placed the setups for the affected page item below.
    Selected setups for P14_PLANNED_START_DATE, all unlisted attributes are blank or null:
    Settings - Value Required: No; Format Mask: MM/DD/YYYY; Show: on icon click; Show Other Months: No; Navigation List for: None
    Source - Source Used: Always, replacing any existing value in session state; Source Type: Database Column; Maintain Session State: Per session; Source Value or Expression: PLANNED_START_DATE
    Default - Default Value: to_char(sysdate, ‘MM/DD/YYYY’); Default Value Type: PL/SQL Expression
    Sample page processes are:
    Validation - Name: P14_PLANNED_START_DATE not null; Type: Item specified is not null; Validation expression: P14_PLANNED_START_DATE; Always execute: No
    Conditions – Condition Type: SQL Expression; Expression 1: :REQUEST IN (‘SAVE’, ‘CREATE’)
    Validation – Name: P14_PLANNED_STARTEND_OKAY; Type: Function Returning Boolean:
    Validation Expression:
    IF SIGN(to_date(to_char(to_date(:P14_PLANNED_START_DATE,'MM/DD/YYYY'),'YYYYMMDD-') || :P14_PLANNED_END_TIME,'YYYYMMDD-HH:MI AM')
    - to_date(to_char(to_date(:P14_PLANNED_START_DATE,'MM/DD/YYYY'),'YYYYMMDD-') || :P14_PLANNED_START_TIME,'YYYYMMDD-HH:MI AM')) > 0
    THEN RETURN TRUE;
    ELSE
    RETURN FALSE;
    END IF;
    Conditions – Condition Type: PL/SQL Function body returning Boolean
    Expression 1:
    IF :REQUEST IN ('SAVE','CREATE') THEN
    IF (:P14_PLANNED_START_TIME IS NULL OR :P14_PLANNED_END_TIME IS NULL)
    THEN RETURN FALSE;
    ELSE RETURN TRUE;
    END IF;
    ELSE RETURN FALSE;
    END IF;
    Database: The attributes for the database column are
    Column Name: PLANNED_START_DATE
    Data Type: DATE
    Nullable: No

    Ligon,
    You're right to think this is pretty laborious stuff. A co-worker wanted to do the same, to make sure users didn't lose a change when clicking Cancel. I suggested he look at calculating the query checksum before and after, which he tried. But it got very cumbersome very fast and he ended up dropping the idea. He's fairly new with Apex, but he's also a quick study, so it's not like he's a novice coder.
    I don't have his implementation details anymore to even share with you.
    Sorry I couldn't be more help.
    Good luck,
    Stew

  • Error on Page - when clicking the date picker

    Hi Gurus and Experts,
    I'm scheduling a report, when i click the date picker in the Report Parameter section, I got an Error on page (the date picker did not pop-out). What is the problem with this? My date parameter is working when not use for scheduling.
    Regards,
    JP
    Edited by: user10955574 on Nov 18, 2010 12:48 AM

    Hi
    I also encounter that error. The error says 'document.forms[...]' is null or not an object. It only occurs in the report parameters sections when scheduling a report. It works fine on viewing the reports and other that has date picker except from scheduling page.
    Please help.
    Thanks.

  • Date Picker BUG on APEX 4.2.1

    Hi all could you please open a ticket for the following bug.
    Reproducing the bug very simple.
    Apex specification :
    version 4.2.1.00.08
    I'm not using HTML 5 template but the classic "Blue and Tan" one.
    1) Create a page with date picker with mask (DD-MON-YYY HH24.MI).
    2) set as default value the SYSDATE using the PLSQL expression (not specifying the mask to_char()).
    3) Try to use it and you will see that the year shown is not the correct one but is something like 1911.
    I fixed using to_char(SYSDATE,'DD-MON-YYY HH24.MI') in the PLSQL expression.

    Hi Zere,
    one very important thing to remember when dealing with session state (the value of a page item) is that everything is stored as string.
    If you specify SYSDATE as your default expression, then the Oracle database will evaluate that as date data type, but as soon as it's stored in session state, the database will do an implicit data type conversion using the default format mask specified for your database session.
    That's why it works when you do the TO_CHAR with the explicit format mask.
    Regards
    Patrick
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf
    Edited by: Patrick Wolf on Apr 10, 2013 3:37 PM

  • When is a span with class lov generated for a Date Picker/Lov?

    Hi,
    can anybody tell me when a surrounding
    < span class="lov">
    is generated around the field and the icon of a date picker/lov and in which situations not?
    Normally this span is always generated but I have already seen it in the past that the span isn't generated by APEX, but I'm unable to reproduce that anymore. Is it theme dependent? But item rendering can't be changed through the templates...
    Thanks
    Patrick

    Hi Carl,
    thanks for your response! Just got the confirmation that with Application Express 2.1.0.00.39 it isn't rendered for Page Item Date Pickers. That's why I can't reproduce it with my 2.2 installation. I already thought it's some setting of the page item/... which I don't see.
    Thanks
    Patrick

  • How to disable the date picker in manualy Tabular form?

    I develope an application with apex 3.2 , I builded a tabular form manualy with APEX API and I have an item 'date picker' , I want that once user want insert the date , he can do it only by clicking on the date picker and not into the item
    I try to use the code that was provided by 'Desnes Kubicek' on his blog , but it does not works
    Any help!!!!!
    I used this code , but that is for an one item form
    <script type="text/javascript">
    function disFormItems(item1){
    disItem = document.getElementById(item1);
    disItem.style.background = '#eeeeee';
    disItem.disabled = true;
    </script>
    2. Region Footer javascript:
    <script type="text/javascript">
    disFormItems('P18_DATE_PICKER');
    </script>

    Hi,
    Try something like this
    SELECT
    APEX_ITEM.DATE_POPUP(4,rownum,hiredate,'dd-mon-yyyy',12,15,'readonly="readonly"','f04_' || ROWNUM) hd
    FROM EMP;Thanks,
    Manish

  • Date Picker problem in APEX 4.1

    Hi,
    I have developed one application in ApEx 4.0 and imported it in ApEx 4.1. In ApEx 4.1, while clicking the Date picker field (on calendar icon) the application is started giving below error :
    Message: Unable to get value of the property '_curInst': object is null or undefined
    Line: 17
    Char: 1448
    Code: 0
    URI: http://*********/i/javascript/apex_4_1.min.js
    I have gone through the below OTN link,But I do not have such scenario which has been discussed over there.
    Apex 4.1 IR: $.datepicker._curInst' is null or not an object
    Other scenario which I have tried:
    In ApEx 4.1, Created a new application with one page having date picker, it is working fine. If I copy/import this page in my old application(which was imported from ApEx 4.0) then the date picker is showing the above error.
    NOte: We are using IE 8 & 9.
    Regards
    Mohan

    Hi,
    We found the problem. The problem is due the file 'jquery.min.js' file we have uploaded in shared components --> images. Once we deleted then it is working fine.
    Regards
    Mohan

  • Date Picker Value Not Date?

    Item: DATE PICKER (USE ITEM FORMAT MASK)
    Format Mask: MM DD YYYY
    Default Value: to_char(SYSDATE,'MM DD YYYY')
    HTML Form Element Attributes: onchange="LoadDates(this.value)"
    Sample Javascript Function w/ 02 14 2008 picked...
    <script language = "javascript">
    Function LoadDates(TheDate){
    alert(TheDate); // Works And Shows 02 14 2008
    alert(TheDate.getDay()); // Doesn't work because TheDate not a Date
    Problem: The date passed to a Javascript Function doesn't act like a date anymore, therefore none of the date functions work.

    Hi James,
    In a wonderful example of inconsistency, the month counting starts at 0. ie Jan=0, Feb=1........Dec=11
    Same for day of the week, Sunday=0, but day of the month starts at 1. Don't ask me if there is a year 0! Also, with the slice method, beginning position starts from 0 and is inclusive but the end position is exclusive. I'm sure there is some logic to it all.
    A good learning resource for web technologies is
    http://www.w3schools.com/default.asp
    but I'm sure there are plenty of others.
    Regards
    Andre

  • Reset data picker page item by selection page item in Apex

    Hi,
    Need to create a report based on date ranges and for this created a interactive report and two page item datepicker fields P15_fromdate and p15_todate. Report works fine with this criteria.But user wants one more field quarter(P15_quarter), When they select the quarter the range values has to get reset and as to get applied to report.
    Issue here is unable to find a way to set the page range item values based on the quarter field selection
    Need help how to reset the page item fields.
    Thanks in advance.
    Thanks,
    Sandeep

    Ligon,
    You're right to think this is pretty laborious stuff. A co-worker wanted to do the same, to make sure users didn't lose a change when clicking Cancel. I suggested he look at calculating the query checksum before and after, which he tried. But it got very cumbersome very fast and he ended up dropping the idea. He's fairly new with Apex, but he's also a quick study, so it's not like he's a novice coder.
    I don't have his implementation details anymore to even share with you.
    Sorry I couldn't be more help.
    Good luck,
    Stew

  • Two questions: Event on a Date Picker and Read Only on a full page?

    Hello,
    I make use of this very informative board to develop an application but i have been unable to find info on these two topics. Sorry if it has been already discussed extensively.
    Using HTMLDB 2.2 for now.
    =>First question:
    I have a date picker item with an event
    onChange="resaStatusChange();"
    in the HTML Form Element Attribute field.
    The event is triggerring if i put a new data in the field but does not trigger if i use the picker.
    Is it a standart behaviour? Is there a way to trigger the event when new data is provided through the date picker?
    => Second question:
    One page in my application has to be used either to only display information or as a mixed displaying/entering data sheet.
    When the context is appropriate to use the page as a simple display (testing both global authorization and data to be displayed), is there a way to put a read only attribute on the full page instead of putting the read only conditions through each and every item of the page?
    Sorry if the questions are not clear and apologize for what should be newbie questions.
    Any link or info will be appreciated.
    Regards,
    Daniel Gureghian

    Hi Daniel,
    I'm not sure about your first question, but I can hopefully give you a helpfull answer for your second one.
    I'm handling it this way:
    var elInput = document.getElementsByTagName('input');
    var elTextArea = document.getElementsByTagName('textarea');
    var elSelect = document.getElementsByTagName('select');
    for (i = 0; i < elInput.length; i++)
      setReadOnly(elInput, true);
    for (i = 0; i < elTextArea.length; i++)
    setReadOnly(elTextArea[i], true);
    for (i = 0; i < elSelect.length; i++)
    setReadOnly(elSelect[i], true);
    function setReadOnly(pThis, pRead)
         if (pThis && pRead)
              pThis.disabled = pRead;
              pThis.style.emptyCells = "show";
              pThis.style.color = "black";
              pThis.style.backgroundColor = "#DDDDDD";
         else if (pThis && !pRead)
              pThis.disabled = pRead;
              pThis.style.emptyCells = "show";
              pThis.style.color = "black";
              pThis.style.backgroundColor = "#FFFFFF";
    I never used it on a whole page, only for regions. So maybe you have to make some changes.
    chrissy

  • Unable to set default date for Date Picker item using Auto Row Processing

    Okay, I have searched through the forum for an answer, and have not found a thing to account for my problem.
    First, does anyone know if using Auto Row Processing has problems updating an item/field in a record where the Source is defined as Database Column if the 'Display As' is defined as 'Date Picker (MM/DD/YYYY)'?
    I ask this only because I found out the hard way that Auto Row Processing does NOT fetch the value for an item where the field is defined as TIMESTAMP in the database.
    My problem is as follows: I have a form that will CREATE a new record, allowing the user to select dates from Date Pickers, text from Select Lists, and entering in text into a Textarea item. The information is saved using a standard (created through the Auto Row Processing wizared) CREATE page level button. After the record is created the user is able to go into it and update the information. At that time, or later, they will click on one of two buttons, 'ACCEPT' or 'DECLINE'. These are Item level buttons, which set the REQUEST value to 'APPLY' (Accept) and 'UPDATE' (Decline). The Accept button executes a Process that changes the Status Code from 'Initiated' to 'Accepted', and sets the Declined_Accepted_Date to SYSDATE, then another Process SAVEs the record. The Declined button runs a Process that changes the Status Code from 'Initiated' to 'Declined', and sets the Declined_Accepted_Date to SYSDATE, then another Process SAVEs the record.
    However, even though the Status Code field is updated in the database record in both Accepted and Declined processing, the Declined_Accepted_Date field remains NULL in the database record (by looking at the records via SQL Developer). WHY??? I looked at the Session State values for both the Status Code and the Declined_Accepted_Date fields and saw that the fields (items) had the expected values after the process that SAVEs the record.
    The following is the code from the Accept button Page Process Source/Process:
    BEGIN
    :P205_STATUS_CD := 'A';
    :P205_REF_DECLINE_ACCEPT_DT := SYSDATE;
    END;
    As can be seen, the Status Code and Declined_Accepted_Date items are set one right after the other.
    As an aside, just what is the difference between Temporary Session State vs Permanent Session State? And what is the sequence of events to differentiate the two?

    Here's yet another thing that I just looked into, further information...
    One other difference between the date field I am having problems with (Accepted_Declined_Date), and other dates (with Date Pickers) in the record is that the Accepted_Declined_Date never gets displayed until after it is set with a default date when the Accept and Decline buttons are pressed.
    One of the other dates that works, the Received Date, is able to write a default date to the record that is never typed into the box or selected from the calendar. That date is placed into the box via a Post Calculation Computation in the Source, which I set up as: NVL(:P205_REF_RECEIVED_DT,TO_CHAR(SYSDATE,'MM/DD/YYYY'))
    However, I do remember actually trying this also with the Accepted_Declined_Date, and setting the Post Calculation Computation did not work for the Accept_Decline_Date. Could this be because the Accept_Decline_Date is never rendered until the Status Code is set to Declined (in other words, there is no need to display the date and allow the user to change it until the record is actually declined)???
    The control of the displaying (rendering) of the date is set via the Conditions / Condition Type: Value of Item in Expression 1 = Expression 2
    Expression 1 = P205_STATUS_CD and Expression 2 = L
    Does this shed any light???

  • How we Can Highlight The dates in date picker item dependin on the database

    Hello All,
    I just want to know how to fetch the data from the database in to a date-picker item..
    I am having a apex-date picker page item in which i need to get dates highlighter depending on database in the tables.To which date i entered the date.. That date need to get highlighted depending on the data in the database tables.
    Thanks
    S.Manoj

    Hi,
    >
    I just want to know how to fetch the data from the database in to a date-picker item..
    I am having a apex-date picker page item in which i need to get dates highlighter depending on database in the tables.To which date i entered the date.. That date need to get highlighted depending on the data in the database tables.
    >
    Write a Before/After Header Computation for the DatePicker item where you select the date from the database table into the item, with appropriate WHERE clause.
    If you want today's date then use SELECT SYSDATE FROM DUAL.
    Use the same Format Mask as specified in the Page Item definition.
    Cheers,

  • How to get lov display value dynamically for an item according to date pick

    Hi friends,
    I have a date picker item called on_date, and also one lov item course_name
    If i select one date from the date picker item means, automatically the course name corresponding to the date has to populate in the course_name item lov.
    suppose if i select the date (21-06-2011) from the date picker item means and if there are two courses available for the date in the table
    that is *) APEX *)OAF means, then the course_name item lov should show APEX and OAF in the select list.
    How to acheive it.
    I tried it in the way by creating a dynamic action for the date item
    True Action: set value
    Sql Expression:
    select course_name from xx_trg_course_detail where :P2_ON_DATE between effective_start_date and effective_end_datepage item to submit: P2_ON_DATE
    Affected element: P2_COURSE_NAME
    it is working if i kept the course_name item as a text field instead of LOV item.
    But i need to show the corresponding courses in the lov for the course_name item soon after selecting the particular date from the date picker.
    This is the LOV definition that i gave for the course_name item
    select course_name r, course_name d from xx_trg_course_detail where :P2_ON_DATE between effective_start_date and effective_end_datewhat is the problem over here.
    Thanks
    Regards,
    Mini
    Edited by: Mini on Jun 22, 2011 2:45 AM

    Hi friends,
    One of my batch mate corrected this problem, by setting
    cascading LOV parent item: P2_ON_DATE
    page items to submit       : P2_ON_DATE
    By specifying the date picker item name in the above fields for the item COURSE_NAME.
    Now if i select the date from the picker means, the lov item course_name is getting changed as it is showing only the courses of the respective dates.
    Thanks
    Regards,
    Mini

  • Date Picker Widget does not work on template spawned (copied) pages

    Hi,
    I am trying to set up a PDF document form for a client using Adobe Acrobat Pro XI.  I have several date fields where I am wanting to use the Form Router Date Picker Widget (which has been downloaded and installed).  This works perfectly fine when it is just one page.  However, I am using a template with a script that creates a copy of the first page activated from a button -- ideally to allow users to create however many pages they want before submitting everything.  The code from the button is as follows:
    var myTemplateArray = this.templates;
    var myTemplate = myTemplateArray[0];
    myTemplate.spawn(this.numPages, true, false);
    // Get the field name prefix that Acrobat automatically adds to the new fields
    var f_prefix = "P" + (this.numPages - 1) + ".cvcIntake";
    // Reset the newly created fields
    this.resetForm([f_prefix]);
    // Go to the new page
    this.pageNum = this.numPages-1;
    The problem begins when a new page is added.  If I try to click on the date picker on the second page, it shows up on the first page next to the same field that was copied.  And if a date is selected it is entered into the field on the first page.
    In looking into what is going wrong I found several things.  First, the naming aspect on the copied page is creating all of the calendar objects with the prefix "P1.cvcIntake.fld" ("fld" is the prefix of the form fields on the first page).  Second, going to the properties of the date picker object, its name has been changed to "P1.cvcIntake.FR_00000_CALENDARBUTTON_fld.Start_Date" and that action code is:
    FormRouter_PlaceCalendar(getField("fld.Start_Date"), 3, "yyyy-mm-dd", 18.61102294921875);
    Obviously both the name and the action code are going to cause it to do what it is doing now.  Unfortunately I am not sure what to try to do to fix things, as my skills at writing code for Acrobat is probably just a little better than beginner.  It seems to me that I need to be using a completely different approach for this part.  Does anyone have any advice on how I might be able to manage this problem?
    Thanks ahead for your time and consideration,
    Mike

    It took quite a while for me to solve this problem, but even longer to post it here (my apologies to anyone looking for a solution to it prior to now).  Anyway, the real trick for me was to discover that I didn't have to explicitly put any numbering notations after adding the new fields (such as + "#" + this.pageNum) -- it turns out that the proper notational numbering is handled automatically.
    While I am sure the real pros out there might be able to find a lot of ways to handle certain aspects better, below is the result of a great many hours of research, trial and error, and persistence.  Considering the help I have received from this forum,  I would be thrilled if I could make a contribution that helps anyone solve this problem.  If so, I would be glad to hear from you!  In any case, if anyone has any comments or questions please let me know. 
    // Get templates in array.
    var aTemplates = this.templates;
    var myTemplate = aTemplates[0];
    // Spawn new form page to end using page renaming.
    myTemplate.spawn(this.numPages, true, false);
    // Get the field name prefix that Acrobat automatically adds to the new page fields.
    var fldNamePrefix = "P" + (this.numPages - 1) + ".cvcIntake";
    // Reset the newly created fields to be cleared of any data.
    this.resetForm([fldNamePrefix]);
    // Init array counter for found calendar fields.
    var calFldsCnt = 0;
    // Array for found unusable copied calendar fields.
    var aCvcIntakeCalFlds = [];
    var pageCnt = this.numPages-1;
    // Loop through all fields.
    for (var i=0; i<this.numFields; i++) {
       var f = this.getField(this.getNthFieldName(i));
       var aNameSlice = f.name.split(".");
       // Find all copied template-renamed calendar fields and save names in array.
       if ((aNameSlice[1] == "cvcIntake" && aNameSlice[2] == "FR_00000_CALENDARBUTTON_fld") || ((aNameSlice[1] == "cvcIntake" && aNameSlice[2] == "FR_00000_Calendar"))) {
          aCvcIntakeCalFlds[calFldsCnt] = f.name;
          calFldsCnt++;
          continue;
       // Skip template-renamed fields.
       } else if (aNameSlice[1] == "cvcIntake") {
          continue;
       // Find non-button calaendar fields to create copy for new page.
       if (aNameSlice[0] == "FR_00000_Calendar") {
          var calFieldsName = aNameSlice[0] + "." + aNameSlice[1];
          var calField = this.addField(calFieldsName, f.type, pageCnt, f.rect);
          var t = this.getField(calFieldsName);        
          // Copy non-function proprties of page 0 calendar fields.
          for ( var p in f ) {
             try {
                if ( typeof f[p] != "function" ) {
                   if (p != "name" || p != "page" || p != "rect" || p != "type") {
                      t[p] = f[p];
             } catch(e) {}
          // Default all to hidden.
          t.display = display.hidden;
          // Set "CalendarMonth" items as they are on page 0.
          if (aNameSlice[1] == "CalendarMonth") {
             var aMonths = new Array(["January", "1"],
                ["February", "2"],
                ["March", "3"],
                ["April", "4"],
                ["May", "5"],
                ["June", "6"],
                ["July", "7"],
                ["August", "8"],
                ["September", "9"],
                ["October", "10"],
                ["November", "11"],
                ["December", "12"]);
             t.setItems(aMonths);
          // Copy button captions.
          if (f.type == "button") {
             t.buttonSetCaption(f.buttonGetCaption());
          // Set action for all calendar "Day_X" fields. 
          if (calFieldsName.indexOf("Day_") > 0) {
             t.setAction("MouseUp","FormRouter_SetCurrentDate(event.target.buttonGetCaption());");
       // Find page 0 calendar buttons and make new page copies.
       if (aNameSlice[0] == "FR_00000_CALENDARBUTTON_fld") {
          var calButtonName = "FR_00000_CALENDARBUTTON_P" + pageCnt + ".cvcIntake.fld." + aNameSlice[1];
          var calButton = this.addField(calButtonName, f.type, pageCnt, f.rect);
          var t = this.getField(calButtonName);        
          // Copy non-function proprties of page 0 calendar buttons.
          for ( var p in f ) {
             try {
                if ( typeof f[p] != "function" ) {
                   if (p != "name" || p != "page" || p != "rect" || p != "type") {
                   t[p] = f[p];
             } catch(e) {}
          // Get button icon copy.
          t.buttonSetIcon(f.buttonGetIcon());
          // Set up variable name for button action that call calendar activation.
          var dateFieldName = "P" + pageCnt + ".cvcIntake.fld." + aNameSlice[1];
          t.setAction("MouseUp","FormRouter_PlaceCalendar(getField(" + "\"" + dateFieldName + "\"" + "), 1, \"mm\/dd\/yyyy\", 0);");
    // Go through array of captured non-usable template-copied calendar fields and buttons, removing each from page.
    for (i=0; i<=aCvcIntakeCalFlds.length; i++){
       this.removeField(aCvcIntakeCalFlds[i]);
    // Go to the new page
    this.pageNum = pageCnt;

Maybe you are looking for