2 Replies Latest reply on Feb 26, 2014 12:11 AM by klothos

    js help

    klothos Level 1



      1) I have Textfield1 and Textfield2

      If i write anything to Textfield1 (for example my name) then i want Textfield to take the value 01 (not 1 but 01 because at Textfield2 i have check Comb of 2 characters)

      2)I have Textfield1,Textfield2,Textfield3.Textfield4 and Textfield5

      Textfield2 is a year for example 2002

      Textfield3 is a month for example 06

      Textfield1 is a day/month/year fore example 25/02/2014

      the question of my homework that am i doing is

      which year and month did you work for last time?

      if it is < or = 8 years(from 25/02/2014-Textfield1) go to Textfield4

      if it is> 8years(from 25/02/2014-Textfield1)  then go to Textfield5

      3)I have Textfield1 Textfield2 and Textfield3

      Textfield1 is a day/month/year for example 09/12/2013

      Textfield2 is a day/month/year for example 15/12/2013

      how can have automatic in Textfield3 the week of this period

      (The period 09/12/2013-15-12-2013 is the 52th week of the year 2013)

      I know it is too much,



      samos island

        • 1. Re: js help
          gkaiseril MVP & Adobe Community Professional

          1) Numbers are by default treated as having the floating point format and that format does not support leading zeros. You need to use a text field and then always use the "valuesAsString" property to access that field's value. Alternatively one could access the value and use the "util.printf" method to pad leading zeros as needed.


          2) You have to convert the dates to a values that are in  an ascending or descending order. This can be done by either reformatting the dates to the format of "yyyymmdd" or to a time unit from a fixed date & time like midnight January 1, 1970, the Epoch date for JS. If you convert the date string to the JS date object then you can extract the full year, month, or day as needed.


          3) You might need more information about how the weeks are being counted or when started. Is is base on the ST day of the year, the first occurrence of a given week day, or some other starting point.

          • 2. Re: js help
            klothos Level 1

            is it possible to write or plan the code to help me?






            2014-02-25 17:36 GMT+02:00 GKaiseril <forums_noreply@adobe.com>:


                Re: js help  created by GKaiseril<http://forums.adobe.com/people/GKaiseril>in

            JavaScript - View the full discussion<http://forums.adobe.com/message/6155283#6155283