Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Populating multiple fields from another field.

Participant ,
May 19, 2016 May 19, 2016

Hello,

In a multi page form, on the first page I have a field called ToDaysDate that will be populated upon opening of the form, other pages have Readonly fields that are called CToDaysDate which on the same JavaScript that is Opening the form, will copy the value of ToDaysDate to CToDaysDate.  It almost works %95 of the times...  Here is the code that is executed upon entry and opening of the Form:

function populate_date()

{

if (this.getField("ToDaysDate").value == this.getField("ToDaysDate").defaultValue) {

this.getField("ToDaysDate").value = util.printd("m/d/yyyy", new Date());

}

}

populate_date(); // call my function

getField("CToDaysDate").value = getField("ToDaysDate").value;

What is so strange is that on page four of this forms, there are two fields of CToDaysDate,  because on this page user either sign on Participating or Non-Participating part based on where user sign, there is a date field of CToDaysDate... Strange thing that happens only the second CToDaysDate is populated the first one is left Blank!!! Why I have no idea... CToDaysDate#2 is left blank but CToDaysDate#3 is populated!  Both CToDaysDate#2 and CToDaysDate#3 are on page four, all the rest of CToDaysDate are populated on the other pages.

I notice if I modify the date populated on the ToDaysDate fields the others keep their old value, I assume that I should run/create JavaScript that runs under the tab of Validation for ToDaysDate and after validating copy the value into CToDaysDate,,, Right?

Regards,

Jeff P.

TOPICS
Acrobat SDK and JavaScript , Windows
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , May 21, 2016 May 21, 2016

PrepareFormsMoreSetFieldCalculationAdjust.jpgPrepareFormsMoreSetFieldCalculationAdjust.jpgTab order is not the same as calculation order.

In the Prepare Form tool look under the "More" option (it is a drop down) and select the "Set field calculation order...".

PrepareFormsMore.jpg

IPrepareFormsMoreSetFieldCalculation.jpg

Adjust the field order by highlighting the field name to adjust and move it up or down as necessary. Click "OK" when complete..

You might want to post a link to the form or a form with a similar issue

Translate
LEGEND ,
May 20, 2016 May 20, 2016

You might want to open the JavaScript console and see if there is any error in your code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 20, 2016 May 20, 2016

Hello,

Thanks for looking at this problem/question... but here is what I had set on my JavaScript debugger console, and no error is poped out.

I even tried with and extra line of code to copy ToDaysDate value to CToDaysDate#2, still came out blank.!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 20, 2016 May 20, 2016

Check the calculation order.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 20, 2016 May 20, 2016

Hello,

I was not sure regarding Calculation Order, but I did some study and I changed the tab order on Page 4 that I have problem, for CToDaysDate#2 and CToDaysDate#3 it used to be 4, 7, I changed it to 4,5 and close the form and reopened it again... result was the same still CToDaysDate#2 was blank and CToDaysDate#3 was populated on Page 4....!

Regards

Jeff P.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 21, 2016 May 21, 2016

Have you tried using a validation script like you initially suggested?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 21, 2016 May 21, 2016
LATEST

Hello,

Not yet I will start working on it... Have any suggestion?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 21, 2016 May 21, 2016

PrepareFormsMoreSetFieldCalculationAdjust.jpgPrepareFormsMoreSetFieldCalculationAdjust.jpgTab order is not the same as calculation order.

In the Prepare Form tool look under the "More" option (it is a drop down) and select the "Set field calculation order...".

PrepareFormsMore.jpg

IPrepareFormsMoreSetFieldCalculation.jpg

Adjust the field order by highlighting the field name to adjust and move it up or down as necessary. Click "OK" when complete..

You might want to post a link to the form or a form with a similar issue

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 21, 2016 May 21, 2016

Hello,

And thanks a million, that you took your time and you responded to my questions and problem.  You are not going to believe what was wrong.... Somehow accidently the fields had been set to Invisible... ... As I was scratching my head for the last 3-4 days, and playing with that field all the parameter's, suddenly I noticed the field has been set to Invisible.  Changed it to Visible and date appeared on the field...

Again and again thanks for your time and response and reading my problem.

Regards,

Jeff P

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines