Changeable Current Date field

I need the "Current Date" field enabled to be changed by the user. Any help will be appreciated.
I thought the "Calculated - User can Override" would work but no such luck! (I am using the Custom - Current Date field)
Thanks

Hi,
The custom current date has the script in the layout:ready event. This fires everytime the user exits an object that has been changed.
So what is happening is that the user can access the date field and change the value, however when they exit the field, the layout:ready event fires and the user-entered data is overwritten by the current date.
You could move the script from the layout:ready event to the docReady event. This is a good event because it only fires once, when the form is opened/rendered.
You will probably need to wrap the script in an if statement, so that when the form is reopened, it does not overwrite the date. The following FormCalc should work:
// Current Date in short-style date format.
if (HasValue($) eq "false") then
     $.rawValue = num2date(date(), "DD.MM.YYYY")
endif
There is an example here: https://acrobat.com/#d=QR1y1RYatwSaQAWa4-jLlA
You can see events and how they fire here: http://assure.ly/gW3RNr
Hope that helps,
Niall

Similar Messages

  • Adding a year to the current date field

    Hello,
    Can any one please help on how to add a year to the current date field.
    e.g 7/19/2011 plus a year = 7/19/2012
    Thanks,
    Han Dao

    If you had a field DateTimeField1 and wanted to display the following year in DateTimeField2, you could do the following in JavaScript;
    var d1 = util.scand("yyyy-mm-dd", DateTimeField1.rawValue);
    if (d1 !== null)
    d1.setFullYear(d1.getFullYear()+1);
    DateTimeField2.rawValue = util.printd("yyyy-mm-dd", d1);
    Good luck
    Bruce

  • Current Date Field question

    Hello
    I'm a novice user of LiveCycle and I'm trying to see if there's a solution for this issue we've come across.
    We've used LiveCycle to redesign human resource/payroll forms in our organization. One of the items we use is the current date field, which automatically populates to today's date once opened. When users complete forms, we encourage them to save an electronic copy of the form to their own drive in case they need to retrieve it at a later date. The problem here is that the current date field will not stay static once filled out and saved.
    For example, if a dept completes a form on 12/1/10, saves it, but then needs to retrieve it later for some reason, we need the current date field to stay as the date the form was originally filled out (12/1/10). If they retrieve the form later on say 2/15/10, that particular date field will read the new date. Is this possible?
    Thanks for any help!

    Test if the field is null before assigning the current date.
    // form1.page1.currentDate::ready:layout - (FormCalc, client)
    if (this.isNull) then
      $.rawValue = Concat(Num2Date(Date(), "MM/DD/YYYY"))
    endif
    Steve

  • Embedding a "Current Date" field in a pdf document

    To assure people work to the latest authorized version of a procedure, we let them access a protected pdf version on our Intranet. They can print a copy for use, but the copy is valid ONLY for the date printed, which is shown in the footer of each page. The "current date" field is updated when the document is opened by way of a Java script that reads:
    var f = this.getField("Today");
    f.value = util.printd("mm/dd/yyyy", new Date());
    (Obviously, "Today" is the field's name.)
    If a person were to open the same document three days later, that later date would be embedded.
    All this worked well when we were using Acrobat 5 and Reader 5. Now, to keep up with the times, we've upgraded to Acrobat 8 and Reader 8 on many PCs. However, the "current date" field still works for those still using Reader 5 but doesn't work for those using Reader 8.
    What I'm wondering is whether the scripting has changed for Acrobat 8. I can't find anything in the Acrobat support documents for Java scripting, but I may not know what I'm looking at.
    Thanks,
    Jerry Holt
    [email protected]

    The problem has been solved!!!
    The form field, the accompanying script, and most documents' security were set up in Adobe 4.0. However, in Adobe Reader 7 or higher, "no changes" means "no changes," so the form field script was blocked.
    By setting Compatibility to "Acrobat 7.0 or greater," I could choose the "Change Allowed" option: Filling in form fields and signing existing signature fields.
    Then, all I needed to do was to confirm that the JavaScript "Today" was still applied, and the current date was immediately filled in.
    Thanks for the questions and suggestions.

  • Can a user override the Current Date field?

    I have a simple form with a Current Date field.  Today's date is automatically populated in this field, but I would like to give users the option to enter a different date in the field.  There is a value called "Calculated - User Can Override" but this doesn't appear to work.

    When I first set up this field I used code I found on this forum that went in the 'layout:ready' area.  I've now removed it and used the code I found in your file in 'calculate'. The date field is now functioning properly.
    Thank you.

  • Problem with current date field...

    I want to display the current date and time, but when I change the data format in the binding tab to "Date and Time" and assign a pattern that includes date and time, all I get is the current date, NOT the time. TIA!

    I have tried applying these scripts in the initialize event to all manner of objects, text field objects, date/time objects, numeric objects, current date objects, and it shows nothing. If I could just edit the date/time format of the current date object when it is set to "Runtime Property-Current Date/Time" I MIGHT be able to use it. I really appreciate your help thus far. Would it be possible for you to share a pdf file that you've made where this works so I might disect it? No matter what pattern I specify in the "Field" palette, it shows it's own formatting.
    UPDATE: I did go back after trying it a few times to change the value after Page1 to match the name of my field.
    UPDATE 2: Here is a link to what I've done. Take a look and let me know what I'm doing wrong, or change it and share it back. Thanks so much for your help!!!
    https://www.dropbox.com/s/1so2hcao372k37z/Script%20Examples.pdf
    Vipin Bhargava wrote:
    I have found 3 more variants. You can write below code on initialize event. It will automatically display the current data & time during the preview
    1.   xfa.form.form1.Page1.TextField1.rawValue
    = util.printd("dd.mm.yyyy HH:MM", new Date()); 
    2.  xfa.form.form1.Page1.TextField2.rawValue = util.printd("dddd d. mmmm yyyy HH:MM ", new Date());
    3.  xfa.form.form1.Page1.TextField3.rawValue = util.printd("date{EEEE, D. MMMM YYYY} time(de){HH:MM:SS Z}", new Date(), true);
    Hope this helps,
    Vipin

  • Number  of days (current date-goods receipt date)

    Hi All,
    I have a requirement like this :
    need to display no of days in Query which is CKF=current date-GR date.  GR date is coming from r/3.We do not have current date field. and moreover no of days is in the selection screen.So we should have no of days calculated already in the cube.am i rght? calculation shold be done before data comes into the cube i.e in transfer rules or update rules...thats what i thought.Am i rght? can anybody come up with some code to calculte no of days in transfer rules or update rules?
    pl correct me if i am wrong.
    regards
    Message was edited by: cmd

    When your write code in transfer rules it will be global.
    if u write code in update rules it will local to on data target.
    Transfer rules----
    InfoSource
    Update reules----
    data target.
    here infosource is re-usable to other datatargets, so it will effect to all.
    but update rules is only one data target.
    i think u clar about this.
    pls assgain poinst, if u satify.
    by
    ANR

  • Auto populate a date field in pdf

    in the form I am working on I have a date/time field. I need it to populate the current date when the form is open. I get it to work but it has the time on it. I only need the date. when I try to change it to display just the date. It will not auto populate ? please help. Thank you for any one who can help.
    using adobe livecycle ES

    I found out how to use current date.
    To add current date fields in LifeCycle
    You can use a date/time field to automatically show the current date by using the Runtime Property option in the Value tab of the Object palette.
    Note:  When using a current date field, the date updates to reflect the system’s current date each time a user opens the form. 
    1.  In the Object Library palette, click the Standard category and drag a Date/Time Field object onto the form design.
    2.  In the Object palette, click the Value tab and select Calculated - Read Only from the Type list.
    3.  Select the Runtime Property option.
    4.  View the form in the Preview PDF tab.
    Hope this helps!
    Brian

  • Problem in date field

    Hello All,
    I have a form which has several date fields.I want to autopopulate these dates to the current date unless and until the user changes it. For ex: We have a DateField 1: When the form opens it shows today's date. If the user does not change this date and if the form is again opened 2 days after,then it shows today's date instead of showing the date which is 2 days after.
    Thanks.
    Bibhu.

    Hi Bibhu,
    There are two problems trying to implement this:
    Preventing the script that calculates the current date, from firing when the form is reopened. This script is probably in the docReady event of the current date field.
    If the form is reopened and the user enters with the field that has the script to set the form data input date then this script will fire again, changing the date.
    I think your best option is to have two readOnly date fields, currentDate (visible initially) and dataInputDate (hidden). These fields would be directly aligned one on top of the other.
    Then in the field that you select as triggering the setting of the date that makes when the user input data you would hide the currentDate and show the dataInputDate. Example in the exit event
    if (this.rawValue !== null)
         currentDate.presence = "hidden";
         dataInputDate.presence = "visible";
         //... set the date for the dataInputDate
    else
         currentDate.presence = "visible";
         dataInputDate.presence = "hidden";
         dataInputDate.rawValue = null;
    Make sure the preserve script changes is ticked in the File > Form Properties > Defaults tab.
    As I say, if this field is re-entered and exited again at any stage then the script will re-fire and change the date.
    Hope that helps,
    Niall

  • Lock current date after save

    In the form I am working on I have a current date field.  When the user saves the form I would like that date to be locked so when the form gets emailed to me and I open it, I can see whent the user sent it.
    Is this possible?  Any help would be great.

    Still having a problem....not working.  Next time I open the form (I've forced a date change on my pc) and it changes to the current date.  Is this correct?
    form1.#subform[0].CurrentDate::preSave - (JavaScript, both)
    if(this.value!=null)
              this.access="readOnly";

  • Check (current) date

    Hi,
    I’ve got a field of the current date which can be changed into another date. The new date is been checked but only for one time and although the error message appears, the wrong date is been shown.
    Can anybody help me please? I think I must write a script code there.
    Wright?
    Thanks in advance!
    Matthias

    Hi Matthias,
    If you are using the 'current date' field from the custom objects, then the script is in the layout:ready event.
    If you move this script to the docReady event it will fire only once and will allow the user to override the date.
    Sample here: https://acrobat.com/#d=QR1y1RYatwSaQAWa4-jLlA
    Good luck,
    Niall

  • Can I create a field that calculates number of days from a date field?

    Hi all,
    I need a field that will calculate the number of days elapsed whatever date is entered into the date field, and update that number of days based on the calendar/computer calendar date.  Does that make sense?
    https://www.dropbox.com/s/arkmnsxjkl4r156/AFBS_FacilitySpecialCareList02.pdf
    I set up the form so that my boss can add or subtract clients from the list.  Each client needs to have its own "Days since added to the list" number. Sorta like a little aging report.
    Is this possible?
    Many thanks,
    Laura

    Wow, I'm so stumped.  I tried to copy a bit of formcalc into the exit event for my current date field to try to make this happen, but I can't get it to work.
    My  attempt at scripting is embarrassing, but here it is:
    form1.sf1.CCSub.CCGroup.#subform[0].DateField2::exit - (FormCalc, client)
    form1.sf1.CCSub.CCGroup.#subform[0].NumericField2.rawValue = Date2Num(DateField1, "MM-DD-YY") - Date2Num(DateField2, "MM-DD-YY")
    and here's the file:
    https://www.dropbox.com/s/arkmnsxjkl4r156/AFBS_FacilitySpecialCareList02.pdf
    Can anyone help me get this right?
    Sign me: One Lost Designer
    Thanks!

  • Restricting date selection of the calender date field

    Right now we have a web app where you choose the starting date of a work week. We're using the calender date field to get that date. However, our client wants to restrict that to just the Mondays of the month. Is it possible to do this?

    Hi Nagy,
    The way I would approach this is by implementing that kind of calendar picker myself, from some jQuery plugin or maybe a couple of simple dropdowns, and then use javascript to populate the current date field which would be hidden. You just have to make sure that the date format looks like this:
    03-Oct-2012
    Cheers,
    -mario

  • How to create a date field which is 16 months before today(current day)

    Hallo,
    I made a report and i want to set date limits. My data contains a date field so in record selection filter i like to set that the date field is between date1 and date2.
    As date2 i set and as date1 i what to set a date which is 16 months before today(first of that month)
    For example today is 08/05/2010 so,
    date2 = 08/05/2010(August 2010)  and  date1 = 05/01/2009(May 2009)
    Any idea?

    Ian,
    Here's a little formula for getting to the first of the month, that's easier than what you've been using...
    To find the beginning of the current month
    DateAdd("m", DateDiff("m", #1/1/1900#, CurrentDate), #1/1/1900#)
    ... or to find the begining of the month. 16 months ago
    DateAdd("m", DateDiff("m", #1/1/1900#, CurrentDate) - 16, #1/1/1900#)
    Jason

  • 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

  • Wrongly posted to asset instead of GL

    Hi All I have a asset which was wrongly  posted as an asset in the last year and now users want to transfer that to a Balance sheet GL account .Depreciation has been run on the same for the last year and the current year  .Any ideas? Can I scrap the

  • Burn won't even start

    hi - i'm trying to burn my project, but whenever i click the "burn" button, it just says "formatting finished" and won't do anything else. i don't even have a disc in the drive! this is the first project i've tried to burn on my new macbook pro - whi

  • How can i take Basic price value as Net value in sales order

    Hello SD experts, I have constructed a pricing procedure, and in that have taken condition type for basic price as rate (cond. type= Price) and have another 3 condition types as surcharges for some internal calculation (but i have to show them in pri

  • Trying to add memory to 24" 2007 iMac

    Trying to add memory to mid 2007 24"iMac. Big surprise - RAM access door screw is stripped. Any ideas about how to remove door panel without damage? Thanks

  • Forwarded email paragraphs in box

    I am trying to turn off whatever function puts boxes around paragraphs of text in mail. When I try to edit/manipulate text in emails that have been forwarded to me, it is difficult to do because every paragraph is set in an individual box. I can see