Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

Remove Submit button from completed pdf

Avatar

Former Community Member

I am creating a fillable pdf with a submit button that will email the pdf from our intranet to a list of recipients.  I would like to remove the submit button, another button that I use to lock all fields button and accompaning text box from the completed form.  Is there a script or other solution that would allow this?  Thanks.

15 Replies

Avatar

Former Community Member

On the preSubmit event you could change all of their presence to invisible. That way the buttons woudl not be visible to the next user.

Paul

Avatar

Former Community Member

Hi Paul,

Thanks for the reply.  That's exactly what I'm looking to do.  I'm not too knowledgable on scripting though, was wondering if you could post or email me code for that.  Thanks in advance.

Charley

Chaueter@vailresorts.com

Avatar

Former Community Member

To hide an object you woudl use the command:

ObjectName.presence = "invsible"

You woudl have to repeat this command for each object you want to hide. If you are unsure about th eobject name, place your cursor in the script editor where you want the expression to appear, hold down the ctrl key and move your mouse to the object you want to reference, then click the mouse. The reference to th eobject will appear in the script editor. Now you can add the .presence = "invisible" part to it.

Paul

Avatar

Former Community Member

Thanks Paul, that's what I needed.  I appreciate the help.

Avatar

Former Community Member

First attachment was .xdp and wouldn't go thru.  What I'm looking to get rid of when I hit the Submit by email button is the accompaning text "***Please Read***" etc.

Avatar

Former Community Member

Here you go .....I added another button (you cannot program a submit button). The other button woudl be visible to the user and you can hide the real submit button. On that button I added code to hide the text and then hit the real submit button.

Paul

Avatar

Former Community Member

Hi Paul,

The .pdf is still sitting in queue.  Would you mind sending it to me directly?  Thanks.

Charley

Chaueter@vailresorts.com

Avatar

Former Community Member

Hey Paul,

May have spoken a little too soon, sorry.  Just about everything works right except for when the form is received by email the fields aren't locked.  Seems like the rhyme or reason is: if the form is static the text will not be removed, and if the form is dynamic the fields are still editable when received by email, although the form looks to have worked successfully when viewing it in reader or acrobat.  Any ideas?

Charley

Avatar

Former Community Member

Thats because the code that locks the fields is on the mouseDown event of the real email button. That event never fires. Move that code to the preSubmit event and you shoudl be good to go.

The code is:

myScriptObject.LockAllFields(form1);

Paul

Avatar

Former Community Member

Paul,

Thanks for getting back to me.  I tried that and still the same result.  No worries though; what I ended up doing is putting the four lines of text into a button that does nothing and have the submit button make that object invisible.  Kinda cheesy, but will work, the end user won't notice the difference.  Thanks again for your help.

On a different note: is it possible to date & time stamp a form with a button?  Haven't had much luck picking through the forums.

Charley

Avatar

Former Community Member

It works for me .....

The date and time stamp ...I am assuming you want a field to hold this information. There is an object in the Custom library called Current data. Drop one of these on your form and have a look at the script behind the layoutReady event. You can do the same thing for the time.

Paul

Avatar

Former Community Member

Interesting... was just trying it again.  I moved that script to the presubmit on the form you sent me and it does complete all the tasks; but when saved and opened in reader the Mailto does not appear and changes cannot be saved.  Then when right are enabled through Acrobat, then re-opened with reader the fields on the form are not locked when it is received by email.

When the same changes are made to the original form in LiveCycle and saved as a Static 7 or 8 pdf the text does not get removed and when saved as a Dynamic 7 or 8 the text gets removed but all the fields are unlocked when received by email.

On the form I've setup a Current Date field and have it working with Date and Time format using the following:

----- form1.Page1.CurrentDate::calculate: - (FormCalc, client) -------------------------------------

var

theDate = Num2Date(Date(), "MMM D YYYY")

var

theTime = Num2Time(Time(), "hh:MM:SS A")

Concat(Num2Date(Date()

, "MMM D YYYY"), " ", Num2Time(Time(), "hh:MM:SS A"))

What I'm looking the do is insert a time stamp somewhere on the form when a button is clicked, rather than when the form is opened.

Charley

Avatar

Former Community Member

I will have to do more digging for the 1st one. For the second one just move that code to the click event of the button. You will have to assign this value to the field in question so use something like this:

Fieldname.rawValue = concat(theDate, " ", theTime)

Paul