Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

I have two question.

Avatar

Former Community Member
First, can you tell me how I can get "Submitted and Valid" to appear and print on a form after a users has clicked the submit button (to an email address or url)? I need this printed on a contract registration page after the user has submitted the completed form.



Secondly, how can I get a table that I've created in Word or Excel and converted to a PDF appear on a form as a pop up type of document when a user clicks (or mouses over a an area of the form) a radio button to just have as a resource for entering data into the form. I'd like to eradicate any paper resources currently being used to complete this form.



Thanks so much.



Victoria Holt
8 Replies

Avatar

Former Community Member
>>>First, can you tell me how I can get "Submitted and Valid" to appear and print on a form after a users has clicked the submit button (to an email address or url)? I need this printed on a contract registration page after the user has submitted the completed form.



You may want to have the value of a static text field change to "Submitted and Valid" after the action is taken.



StaticText1.value.text.value = "Submitted and Valid";



Here is an example:



http://66.34.186.88/LiveCycleSamples/.3bbcc8fa.pdf

Avatar

Level 7
Take great care if this has some legal status, and you are e-mailing.

Clicking submit doesn't guarantee an e-mail is received. It doesn't

even guarantee it is sent.



For submitting to a URL (program on a web server) this is different.

You can guarantee that it is stored on the server (but do consider the

case where the server immediately crashes).



Aandi Inston

Avatar

Former Community Member
Dear Jimmy,



Thank you for the fabulous scripts you sent me on getting a PDF to pop up when a radio button is clicked or when a pull down list is moused over. THANK YOU! Your directions worked beautifully.



I am still working on the most important need I have which is to get the words "Submitted and Validated" to appear and print on a form, just like the one you set up and posted above in response to my first request for your help.



Several problems. When I went to the link above and saved your PDF and opened it, there was no scripting in either the email or text boxes. In fact I didn't see anything at all with regard to Form Calc or Java Scripting. No settings at all, everything was at initialize in your PDF. I also did not notice any other special settings.



I used the script you sent me: StaticText1.value.text.value="Submitted and Valid" on my own PDF. First, I added a text box (without any text inside, just the text box) and named it StaticText1. Then, highlighted the email button and selected Click and then put the script in from above (exactly like this: StaticText1.value.text.value="Submitted and Valid"; )while I had the Email Submit Button Highlighted. This actually caused my email button to not work at all after viewing and using the button in the PDF mode. My email button worked prior to me doing this scripting. Additionally, when I clicked my email button the text "Submitted and Valid" did not appear or print anywhere on the page where the blank text box was placed.



Then I tried the Form Calc setting instead of the Java and nothing good happened. A couple of error messages happened while experimenting with different things which I sent in.



What am I doing wrong or missing here? All I need is for mine to work just like the one you made in the link above.



Your help would be the right medicine for my stressed state. Please help me once again.



Thank you and I hope you will lend me your brain once again.



Best regards,



Victoria Holt

Avatar

Former Community Member
Dear Jimmy,



Another heart felt thank you for your wonderful email that showed me screen shots modeling the script to make the serial number in a form field appear in the subject line of the email. After you sent me to screen shot yesterday, I went back to the PDF on line and copied and pasted the scripts. It made mine also work.



Now I need some additonal help with another script. You have given me some great inforamtion on the second question already and a sample PDF to boot on line (link above) that shows how to make "Submitted and Valid" appear on the page after the email button has ben clicked.



The same button that has the scripting to link the Serial Number in the subject line of the email also needs to make "Submitted and Valid" appear after the email button has been clicked.



I have used the script you gave: StaticText1.text.value="Submitted and Valid"; and included it both before and after the script that makes the Serial Number appear in the email subject line. Unfortunately, nothing happens.



I also tried using your "Submitted & Valid" script in a new form to mimic the sample you sent above to see if it would work in seclusion. Mine did not work when trying to just get a new button to print "Submitted and Valid".



Do you know what I could be missing? Also, where will I place this new scipt to make "Submitted and Valid" appear within the scirpt that makes this button also put the Serial Number in the subject line. Is getting it to do both simultaneously possible or will I have to use a different avenue or sepeate buttons?



Also, I noticed your script is formatted vertically. Mine will only go horizontally. Could this be my probelm? If so, how do you get your script on different vertical lines?



Thank you for lending me your time and expertise in such a timely manner these last two weeks. I really appreaciate your much needed assistance and look forward to your kind email replies.



Best regards,



Victoria Holt

Avatar

Former Community Member
If you want to combine the 2 examples, your javascript on the "click" event of the button should look like:



StaticText1.value.text.value = "Submitted and Valid";

var emailSubject = TextField3.rawValue;

var myDoc = event.target;

myDoc.mailDoc(

false,

"someone@somewhere.com",

"ccSomeone@somewhere.com",

"bccSomeone@somewhere.com",

emailSubject,

"Email body goes here."

);



One thing that I want to point out as Andi in previous post mentioned. Even though you display "Submitted and Valid" on the form as soon as the user click on that button, technically, nothing is submitted at this point. At this point, if the user decide to cancel the email pop up window from Outlook, nothing is sent.

By seeing "Submitted and Valid", this might give the user a wrong impression that he/she did send something. This is a flaw in this implementation.

Avatar

Former Community Member
Dear Jimmy,



Your script worked!



Your brilliant and wonderfully helpful.



Many, many thanks.



Have some other questions on different topcis but I will post them in new messages with new titles that reflect the content so that others can search and review also.



Victoria Holt

Avatar

Former Community Member
Dear Jimmy,



I now need to replalce the text that read "Invalid until Submitted" and then changed and read "Submitted and Valid" after the Submit Button has been clicked to something a little different.



I now need text to read "Draft for Review" on the form until the submit button is clicked. This text "Draft for Review" needs to disappears or becomes invisible after the email button has been clicked on the form.



I am now trying to make my form:



(1) require a date field entry in a date/time box in order to submit the form by email.



(2) take the serial number from a field and put it in the email submect line.



and (3) make the text "Draft for Review" text disappear or become invisible,



ALL 3 need to happen, when the submit button is clicked.



Can you tell me why the scripting I have below will give the message I want, "Please enter the date the Silver Coverage Inclusions were explained" if the date is not entered but go ahead and then, open email without making them enter the date after they click OK when the request message to enter the date come up? This allows the form to be sent WITHOUT the form user really entereing the date because the email opens up next.



Fortunately, my "Draft for Review" text disappears.



The Scripting being used is:



if(T100.rawValue == null)

{

app.alert("Please enter date selling dealer explained Silver Level Coverage Inclusions.");

xfa.host.setFocus("T100");

}



StaticText3.presence = "invisible";



var emailSubject = serialNumber.rawValue;

var myDoc = event.target;

myDoc.mailDoc(

false,

"engineesc@cat.com",

"ccdavid.holt@cat.com",

"bccSomeone@somewhere.com",

emailSubject,

"Email body goes here."

);



Can you tell me how to make all three work together correctly?



Thank you,



Victoria Holt

Avatar

Former Community Member
Try using the preSubmit event instead of the click event. By putting code into the click event, you are overriding the form submission.