Copy link to clipboard
Copied
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?
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.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
I've attached the file and the person who created it isnt available. Thanks for your help.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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]
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Adjust all the instances to match the new field names, correct?
Copy link to clipboard
Copied
Yes.
Copy link to clipboard
Copied
Cool. Will try later this eve.
Copy link to clipboard
Copied
Thanks!
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Share the new file with us, please.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
The issues I described before are not fixed in this version.
Look at the top of the Edit All JavaScripts window:
Those tags should not be duplicated. It means the file's internal code structure is corrupt.
Copy link to clipboard
Copied
Is the only solution to start from scratch?
Copy link to clipboard
Copied
Pretty much, yes.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Please share the new file.
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Check the console for errors.
Copy link to clipboard
Copied
This is what I get
TypeError: getField(...) is null
286:App:Calculate
Copy link to clipboard
Copied
That means you entered an incorrect field name.
Copy link to clipboard
Copied
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?