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

Stamp not working - Please help

Community Beginner ,
May 06, 2021 May 06, 2021

I'm new here however, I'm working with an existig stamp and code done by someone else.  When  I post the stamp, the dialog pops up for me to select one checkbox and input text in to 5 text boxes. The other 2 text boxes on the dialog (name, date) are prepopulated (via the code) .  When I click Ok, the stamp only displays the current date and output from one selection.  It is supposed to display:

The checkbox I clicked 

The text I entered in the correspoinding fields 

And the prepopulated name should carryover as well.

 

Why is only 1 field displaying properly?  

TOPICS
JavaScript , PDF forms
15.3K
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
1 ACCEPTED SOLUTION
Community Expert ,
May 12, 2021 May 12, 2021

The radio-buttons in the stamp file itself should be named "Action" for your current code to work. You can name the ones in the dialog whatever you want (as long as its 4 characters). The two are not related.

View solution in original post

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
Community Expert ,
May 06, 2021 May 06, 2021

The code is not working correctly. Without seeing the stamp file itself we can't help you further with this issue.

Why not ask the person who created it to fix it for you?

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
Community Beginner ,
May 06, 2021 May 06, 2021

I've attached the file and the person who created it isnt available.  Thanks for your help.

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
Community Expert ,
May 06, 2021 May 06, 2021

Someone edited the code in the file via the Edit All JavaScripts command, which you should never do (despite its name), and it completely messed it up. I hope you have an earlier version of this file saved, as fixing this issue is not always possible.

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
Community Beginner ,
May 06, 2021 May 06, 2021

I do.  The task is to edit or update the stamp.  So I suppose the question is how is the best way to do that?  I  took the flat image.pdf of the stamp and copied then modified the code from the old stamp in to it.

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
Community Expert ,
May 06, 2021 May 06, 2021

Copy the code from field to field. It would be an easier task if all the code was placed under one field, or even as a doc-level script.

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
Community Beginner ,
May 06, 2021 May 06, 2021

Doc level...I copied thecode.txt to the Java Scripts folder and changed to .js and I hv it in the stamp. Does it only need to be in one location only?

And all the code should go in one field? Does it matter which?

[Private info removed]

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
Community Expert ,
May 06, 2021 May 06, 2021

Do not edit the code via Edit All JavaScripts! Nor should you copy it from there, as it includes a bunch of tags that you shouldn't enter anywhere else.

 

Copy the code from each field and place it under one field.

You'll need to adjust all the instances of event.value to this.getField("").value, though.

 

And don't reply by email. It includes all your private info in the signature and posts it to the forum.

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
Community Beginner ,
May 06, 2021 May 06, 2021

Adjust all the instances to match the new field names, correct?

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
Community Expert ,
May 06, 2021 May 06, 2021

Yes.

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
Community Beginner ,
May 06, 2021 May 06, 2021

Cool.  Will try later this eve.

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
Community Beginner ,
May 06, 2021 May 06, 2021

Thanks!

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
Community Beginner ,
May 07, 2021 May 07, 2021

Hi,

 

So I opened both stamp files and copied code from the textfield properties of the field (it contained all of the code, btw) in to the appropriate field in new stamp (properties, calculate, custom calulated script, edit.  deleted existing code and replaced w/pasted code from old stamp).

 

Edited pasted code (in that window).  I changed stamp name, added 2 new jsadmdlg1 variables and 2 new getfield lines

Saved file and closed acrobat

Reopend and tried

 

When I placed stamp the old dialog appeared and when I clicked Ok, the new dialog appeared w/o any of the data I entered.

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
Community Expert ,
May 07, 2021 May 07, 2021

Share the new file with us, please.

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
Community Beginner ,
May 07, 2021 May 07, 2021

Attached. 

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
Community Expert ,
May 07, 2021 May 07, 2021

The issues I described before are not fixed in this version.

Look at the top of the Edit All JavaScripts window:

 

try67_0-1620391508870.png

 

Those tags should not be duplicated. It means the file's internal code structure is corrupt.

 

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
Community Beginner ,
May 07, 2021 May 07, 2021

Is the only solution to start from scratch?

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
Community Expert ,
May 07, 2021 May 07, 2021

Pretty much, yes.

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
Community Beginner ,
May 10, 2021 May 10, 2021

I created a new stamp file and copied all of the code to one field.  Then I edited code to reflect the new fields and stamp name.  

When the stamp is placed, the dialog appears, yet when I fill it out, ONLY one field is captured. I don't understand.  The "old" stamp that contains the code works.  Why is the data input not showing up on the new stamp? 

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
Community Expert ,
May 10, 2021 May 10, 2021

Please share the new file.

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
Community Beginner ,
May 10, 2021 May 10, 2021

File attached.  

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
Community Expert ,
May 10, 2021 May 10, 2021

Check the console for errors.

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
Community Beginner ,
May 11, 2021 May 11, 2021

This is what I get

 

TypeError: getField(...) is null
286:App:Calculate

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
Community Expert ,
May 11, 2021 May 11, 2021

That means you entered an incorrect field name.

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
Community Beginner ,
May 11, 2021 May 11, 2021

Ok.  I will triple check field names.  BUT I have the code in 2 places:

The Custom calculation script of a stamp field and as a .js file in C:\Program Files (x86)\Adobe\Acrobat DC\Acrobat\Javascripts 

Is that right?

 

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