Look at the debugger for errors.
I don't know how to use it and it crashes the program. Wouldn't the debugger just show any punctuation mistakes in the code, but show nothing if I've just written the wrong code to work?
The first event.value = app.response is wrong
I tried putting the following brackets, but didn't help
event.value = app.response ();
Can you please elaborate on what I have done wrong with this line? If I can get it to pop up right when I press stamp and get the first couple of things to work correctly I assume I can join all the others on using the same type of code seeing as they worked separately before just not with the stamp identity stuff.
Am I correct that the stamp needs two calculation fields for the stamp identifiers to work properly with pop ups? This part below and the part at the top of my code mentioning event.source.forReal?
event.value = event.source.source.documentFileName;
Why did you add this line?
Because I don't really know how the coding works, I tried to piece it together from guides I have found.
You seem to give very cryptic answers to show that you know whats wrong or to make me think you do, but without actually helping. If you don't want to help that's fine but your not helping me at all like this so why are you posting?
Take the line out. It's wrong. It doesn't belong. Clear enough?
To start, just as a helpful communication tip. It is a good idea to try and post code with proper formatting so we can follow it. This is especially important for large scripts.
First thing to do, remove the "event.value = app.response" line.
Just looking at the code there is one glaring issue. "event.value" refers to the value of the form field in which this calculation script is placed. Yet it's used for all the response boxes. For setting the other field values you need to use "this.getField().value"
Typically, if the response box is popping up when you show the stamps menu, then the response box code is unprotected. This is because the stamp script is executed every time the stamp menu item is exposed. However, you're script does protect the calls to app.response. So your description and the code you've posted don't match. There must be other code in the stamp file that is displaying the response box.
There are two ways to approach a fix.
1. Delete all code in the stamp file and start over with one response box in one field calculation script. Once you get that working, then try another, and remember, all calculation scripts must be protected with the first if statement in your code above. i.e. the if that use "event.source.forReal"
2. This is the really easy solution. Joel Garcia created an incredible tool for automatically creating dynamic stamps, and its free!!! Down load it from here:
Thanks for your input although the screenshot of the example at top of page is from that guide
Thanks for your more in depth response, that makes it a bit more clear. I'll have a go with these options and let you know how I go.
Hi Jeremy, Glad I could help, and I hope your stamp was a success.
But Now there is yet another option for your dynamic stamp input. It does however require some slightly more advanced programming. At PdfScripting.com you'll find a dialog box editor. This is a much better UI option than all the response boxes. The editor makes creating the dialog code easy, but you still have to hook it up in your stamp code.