Disabling all fields when submitting PDF by Email

This is in response to a request I received earlier today.The request was “How do I submit PDF by Email, and when the PDF reaches the recipient, all the form fields should be set to read only”. I have created a simple form which sets all form fields to read only once the user clicks the “Email Submit Button”. The script which sets the fields to read only is in the MouseDown event of the EmailSubmit button. I have put the xdp,script to set the fields to read only in a PDF as file attachments which can be accessed by clicking here(Click on the paper clip icon to access file attachments)
Submit PDF By Email
To ReaderExtend the PDF form which will allow Adobe Reader users to submit the form follow the instruction mentioned here
How to ReaderExtend form using Acrobat
Let me know if you have any questions

144 responses to “Disabling all fields when submitting PDF by Email

  1. Is it password-protected?

  2. Girish Bedekar

    The PDF in the link is password protected,but you should be able to access its file attachments by clicking the attachment icon

  3. Perfect!! Thanks a million.

  4. Hi Girish,

    I would like to get a code when it becomes readonly, I don’t want those borders anymore which in turn is for printing purpose.

  5. Girish Bedekar

    Hi
    If I understand you correctly, you want to make the form fields read only?

  6. Yeah, I need to make the fields readonly, at the same time I don’t want those borders (of text field)on the printout. Can you help me on this?Thanks for your response.

  7. Hi, I am new at lifecycle designer, and your solution is the one I am looking for, unfortunately being new; I looked at the sample but still could not figure out how to do so. I can check the javascript but could not open the xdp file. Please help.

  8. Hi, I finally figure out to just apply the script from your sample on the click function of submit button and it works perfectly! 🙂 Thanks so much!

  9. Girish Bedekar

    Glad to hear you got it working
    let me know if you need any further help
    cheers
    Girish

  10. Hi, the pdf file is password protected and i wasn’t able to open it, how can i open the pdf file, i need this sample badly, please tell me how to access the file, and base on “Girish Bedekar”, another way to access it is by clicking the attachment icon, where can i see that icon? Can anyone help me, Because im having a problem regarding the email button in pdf, can any one give me a sample code, so that when i fill out the email field in the form then click the email button the form will me send in the email address i put in the email field.. Hope for your response as soon as possible..

    Thanks and God bless..
    Christian

  11. Hi
    Thanks for pointing the error.It is fixed now,you should be able to access the file attachments now,
    let me know
    thanks
    girish

  12. hi Girish Bedekar,

    i was able to access the pdf file only for viewing it in the pdf viewer, but when i try to to open the pdf file in the LifeCycle Designer, still asking for the password, i want to see the xml source of the pdf file, beacuse when i try to click the “Email Button” in my pdf that im working now, the pdf does not include as an attachment, Can any one know how to fix it (using code), so that when i click the filled-up pdf form and click the email button it will be send and the form that you filled-up will be included in the email as an attachment, so that the receiving person will be able to ready the pdf file..

    Thanks and god bless..
    Christian

  13. Hi
    The PDF file in the link is password protected,however the xdp file(file attachment) is not password protected and you should be able to open the xdp file without any problems.
    thanks
    girish

  14. Hi,

    How can i access/open the xdp file (file attactment) in my local machine?

    Thanks and god bless..
    Christian

  15. hi,

    I can’t open it to my Adobe LifeCycle Designer, it has password, can you please give me the password for the attactment file, i need to see the codes (XML) of the file.

    Thanks and god bless..
    Christian

  16. Hi,

    Im having probelem regarding the email..When i try to email the PDF, i was able to sent it but the person who receive the email, receive like this:

    begin 600 charter_form.pdf M)5!$1BTQ+C>+CS],-“C(Y.” P(&]B:@T\/”]&:7)S=” Q,34Y+TQE;F=T M:” Q-3(V+T9I;’1E7!E+T]B:E-T;3X^ M<W1R96%M#0IXVH1836\’X9OC@&HL@15,’ MAE,T_[Z/&DWBM5&7S($B,%DP&D@# MD:&R.8#1’#$</&’#-8S E1A(@”L42($K”2-P!7P9N *^;#CP%<-EBP0C^*KA MP-&0*@6N M@2\#U\!7@&O@*\ U\%7@&O@J’M[ UV)!+@(+26@%(U+;*D8XT5I@)00)#K8, M4T05U-(140>%’45&09(E4#!!>2@J)M7 H”W1P. M;& 0EYYM,!>X103FFI ‘ M/(8K8$YHK(B,#<*%M),($TB,#,5&;-$SJ4)!94″), M!*5)”1,S3UT] ,-O26P3Q60K-R;-K,#,R:S S!87’B-<30(F5 “)P2S0(,2! M”1)&#&9%3,mailto:1@5F-F,*L) /&C5C8!)BP@<%L:B(!9F<E1T0HRF4\($$1!”TF@) M1\$U0E*$2+1GS/JI9PP=I=157C”!’ @&FMB6&B:6L=Z-T 6AMY01+EH $^L5 M]!=48Q@PBQC&.M7″08NI6@E H8HHT3″8]”4P9

    Any one can help me resolving this problem im having, the pdf file should be send as an attachment, but is not and the above symbols displayed. Im using Adobe Acrobat 8 and Adobe LifeCycle Designer 8. Is there other software needed to resolved this? your reply is highly appreciated..

    Thanks and God bless..

  17. Hi,

    Im having probelem regarding the email..When i try to email the PDF, i was able to sent it but the person who receive the email, receive like this:

    “begin 600 charter_form.pdf M)5!$1BTQ+C>+CS],-“C(Y.” P(&]B:@T\/”]&:7)S=” Q,34Y+TQE;F=T M:” Q-3(V+T9I;’1E7!E+T]B:E-T;3X^ M<W1R96%M#0IXVH1836\<-PS]*

    Any one can help me resolving this problem im having, the pdf file should be send as an attachment, but is not and the above symbols displayed. Im using Adobe Acrobat 8 and Adobe LifeCycle Designer 8. Is there other software needed to resolved this? your reply is highly appreciated..

    Thanks and God bless..

  18. Thanks! This is just what I need right now. Worked like a charm!

  19. I am using LCD-ES 8.2.1. Your script works perfectly to lock the fields when the pdf form is submitted by e-mail, however using it changes the system-generated message in the body of the e-mail.

    Without the script, the system-generated e-mail message reads: “The attached file is the filled-out form. Please open it to review the data.”

    With the script, the message reads: “The attached file contains data that was entered into a form. It is not the form itself.

    The recipient of this data file should save it locally with a unique name. Adobe Acrobat Professional 7 or later can process this data by importing it back into the blank form or creating a spreadsheet from several data files. See Help in Adobe Acrobat Professional 7 or later for more details.”

    Is there a way to use your script to lock the fields AND keep the first message that refers to the completed form?

    Thank you.

  20. Hi
    I was not able to reproduce the problem,is it possible for you to send me the form.I shall take a look
    mergeandfuse@gmail.com

  21. I found that there is no problem with the e-mail message when I tested the form from Adobe Reader. No message was generated.

    It seemed to only occur in LCD when I tested the e-mail button from the PDF preview.

    Thank you for checking it out.

  22. I am not able to open this form as it is password-protectec and I cannot see the attachment icon either. appreciate your help.

  23. Thanks Girish for this great post.

    Rather than locking ALL fields, is it possible to lock only certain fields and leave the others unlocked ?

    eg: in a pre-filled order form, LOCK the Name & Address fields but keep all other order items unlocked.

    Appreciate any help.

  24. Here is a sample code which will make the name field read only, leaving the other fields on the form editable
    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
    {
    var oFields = xfa.layout.pageContent(nPageCount, “field”);
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
    {
    if(oFields.item(nNodeCount).name == “Name”)
    {
    oFields.item(nNodeCount).access = “readOnly”;
    }
    }
    }

  25. Thanks very much Girish. This code does not seem to work for drop-down lists.

    I suspect I have to change this line:
    var oFields = xfa.layout.pageContent(nPageCount, “field”)

    What can I do to make drop-down lists read-only ?

  26. Figured it out. Copying and pasting from this blog causes some problems with the inverted commas:

    The following works perfectly, thanks.

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)
    {
    var oFields = xfa.layout.pageContent(nPageCount, “field”);
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)
    {
    if(oFields.item(nNodeCount).name == “Name”)
    {
    oFields.item(nNodeCount).access = “readOnly”;
    }
    }
    }

  27. Girish, when I click the Email Submit button and fields are made readonly…

    How can I :
    1. Rename the attachment
    2. Add a subject and body to the email

    Thanks

    • I do not think you can rename the attachment. To add the subject and body, mailto:someone@somewhere.com?subject=Hello%20again”. About body I think you will need to google it
      I do not remeber the syntax

  28. I use this in the Button preSubmit code

    this.resolveNode(“#event”).submit.target = “mailto:” +
    “someone@aaa.com” +
    “?subject=Meeting&body=Hi.”;

    BUT I need to generate the email dynamically without addressing it, ie: nothing in the TO field.

    Using your example, how do I do this ?

  29. Also what about using setDocumentAttribute – will that rename attachment ?

  30. Hi,

    I’m completely new to Adobe LiveCycle, and I’m trying to design a doc for work. This is exactly what I need (read only after doc is submitted), but I can’t figure out how to get the code. There is no hyperlink under “clicking here”, and I’m not finding the paperclip icon. Am I totally blind or could it not be showing up on my browser (Explorer 7) for some reason?

    Thanks!

  31. Hi,
    There must be a problem…I, too, don’t see the paperclip icon (I tried with IE7, FF, Opera & Chrome). Could you send it to me, please or make a clickable link ?
    Thanks,
    Ksev.

  32. Thank you for the very useful script excerpt, which works well for me.

    I’d like to be able to disable text fields AND hide buttons on submit. When the inner do-loop (loop through fields on a page) is making use of the pageContent method to get each field, is there a way to detect which fields are buttons, so that when I find buttons I can set their presence to “invisble”?

    The documentation on pageContent says that buttons will be located, I just need to know which fields are buttons and which are not.

    • Hi
      I shall find out and get back to you on this
      thanks
      girish

    • Hi
      here is the script which will disable only the text fields
      for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {

      var oFields = xfa.layout.pageContent(nPageCount, “field”);
      var nNodesLength = oFields.length;
      for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
      if (oFields.item(nNodeCount).ui.oneOfChild.className == “textEdit”)
      {
      oFields.item(nNodeCount).access = “readOnly”;

      }

      }

      }

  33. Hi,

    Thanks for posting this very useful script! I added it to my PDF and it works great. I’m wondering if there is a way to still allow the recipient to copy and past text from the text field? As it is, they can copy and past the box’s titles, but not the text actually in the box.

    Thanks again for all of your help!

  34. ah, I do not think so, but anyway I shall confirm and let you know
    thanks
    girish

  35. Maybe there is a way to disable drop down boxes, but not text boxes?

    • Hi
      here is the script to accomplish that
      for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {

      var oFields = xfa.layout.pageContent(nPageCount, “field”);
      var nNodesLength = oFields.length;
      var nCount = 0;
      for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
      if (oFields.item(nNodeCount).ui.oneOfChild.className != “textEdit”)
      {
      oFields.item(nNodeCount).access = “readOnly”;

      }

      }

      }

      Let me know if this works
      Thanks
      Girish

  36. I tried adding the script below and emailing it to myself. I was still able to make changes to all of the fields though. Has anyone else tried it? Thanks!

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {

    var oFields = xfa.layout.pageContent(nPageCount, “field”);
    var nNodesLength = oFields.length;
    var nCount = 0;
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
    if (oFields.item(nNodeCount).ui.oneOfChild.className != “textEdit”)
    {
    oFields.item(nNodeCount).access = “readOnly”;

    }

    }

    }

  37. I have created a fillable PDF form with Live Cycle 9 with a working email button. The fillable PDF will be used by several people I work with, who then email it to me for distribution via email to other individuals are intended as read only recipients. I need to “re-secure” the PDF before re-distribution. Is there code for this action to automatically re-secure the PDF?

  38. Also, I used the code given on this post and received the following error:

    syntax error near token ‘(‘ on line 1, column 5.

    Thanks.

  39. Girish- Disregard my last post. I had the code right, but forgot to check the LANGUAGE pull down menu to JAVASCRIPT. The error is gone and my PDF works. Thanks.

  40. Hi, I saved your file but I’m not seeing a paperclip icon anywhere? Can you post the raw code here? Or explain to me how to get to this ‘attachment’?

    thanks

    • The paper clip icon is on the left side, if you do not see it you can do “View | Navigation Panels | Attachments” to see the attachments window open up
      let me know if you still have a problem
      thanks
      girish

  41. Hi..I’m new to LiveCycle. I need to make the form read only upon submission, however I have required fields and if they click submit, yet they haven’t completed all required fields, they are now unable to update the form after clicking the email submit. Any advice?

    • Hi Spikyles
      The following code wold exit if the Name field is left blank. So the fields will not be set as read only when the user clicks the email button
      here is the sample code
      if(Name.rawValue == null)
      {
      exit();
      }
      for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
      var oFields = xfa.layout.pageContent(nPageCount, "field");
      var nNodesLength = oFields.length;
      // Set the field property.
      for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
      oFields.item(nNodeCount).access = "readOnly";
      }
      }
      Let me know if you need more help
      thanks
      girish

    • Hi Carrie
      To hide the email button when the other user gets the form in email you would just need to add the following line at the very bottom of the script after the 2 }} braces
      this.presence = “hidden”;
      the following is the complete script
      for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
      var oFields = xfa.layout.pageContent(nPageCount, "field");
      var nNodesLength = oFields.length;
      // Set the field property.
      for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
      oFields.item(nNodeCount).access = "readOnly";
      }
      }
      this.presence = "hidden";

  42. Your code worked excellent on making all of my fields and buttons read only, after the PDF is submitted. Thanks! But is there additional code that will hide a button as well as make it read only? I’m trying to hide a button after the PDF is submitted via email.

  43. Thanks so much for your quick reply. This works perfectly. This is such a great help!!

  44. Thanks Girish, for your quick reply and code!

  45. Sorry but I ran into a snag. I’m having trouble with the drop down boxes. Here is my example code for the fields so far:

    if((TextField1.rawValue == null) || (TextField2.rawValue == null) || (NumericField15.rawValue == 0) || (Reason.rawValue == 0))
    {
    exit();
    }

    What would the drop down boxes be (Reason)? Same question for a decimal field. null or 0 do not work. Sorry, I am completely new to this and appreciate the help.

    • Hi Carrie
      This code is working for drop down list
      if (DD.rawValue == null)
      app.alert(“Null in dd”);
      If the user has not made any selection in the drop down list
      you would get the alert box

  46. Girish- I found the way to hide my button ! In the properties of the button, not through code, I changed the color of my button to a dark gray with a white font. I then added this line of javascript code to the end of your code-

    Button1.fillColor = “255,255,255”;

    Once my button is executed, your code executes and my button turns white (the same color as my form) and is therefore read only and hidden.

    For your readers and reference, the Button1 is the name of my button, and obviously would change according to the user of the code and the name of their own buttons. The sample code that I referenced, and forgive me for not being able to give proper credit, is:

    yourbutton.fillColor = “255,255,255”;

    I found a javascript color chart to get the 255,255,255 which is the color white.

    Thanks again for all of your help. 🙂

  47. Regarding my original question about setting the form to “read only” but have them complete required fields if they forgot after clicking Submit, I have a question:

    Is there an object or event that we can check to see if the entire page has passed validation instead of checking each individual field for a value. For example, is there something like: if page is not valid, then exit?

  48. I do not think so

  49. How/where do I add the code on the Email Submitt button? I find no “on mouse over” referance.

    • Open the script editor from “Window | Script Editor” menu
      You will find mouse down,mouse up and other events
      thanks
      girish

  50. Can you please repost… I am new to the whole PDF FOrm Scipting. Any help would be appreciated.

  51. Ok…I know this can’t be that hard. I can’t even find the Paper Clip Icon? I found where in LiveCycle to put this, I just need help downloading.

  52. Hi Girish,

    Very helpful script. I see a question was asked around the issue I’m up against. How can we make the read only form selectable? My recipient needs to be able to select data entered and copy into a new document. Thanks!

    • Hi Andrew
      So you want the emailed form to be read only, but be able to select data and copy it into a new document?,
      girish

  53. Hi Girish,

    Yes. That is the functionality I am trying to dial in.

    THANKS!
    Andrew

  54. Hi Girish:

    Thanks for the help previously, everything worked great, once I familiarized myself with the application. One quick question? I have a few fields, First Name, Last Name. Can I get it to submit a PDF via email, and name the attachment FirstName_LastName.PDF?

  55. Thanks Girish, but I have only one form that I need to do this with, it seems as if this software would be an overkill for this simple task. Thanks for your expertise.

    Jason

  56. Hi Girish, the script to make the entire form read-only works great, but what line do I need to modify to allow my buttons to function? In particular I need the print button to continue to work once the form is read-only. Thanks!

  57. I found the line I needed to change for the print button, but when I save the form my fields are still editable. Do I need to change any settings before I extend usage rights to the pdf for Reader? Here’s the script I’m using:

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
    var oFields = xfa.layout.pageContent(nPageCount, “field”);
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
    if(oFields.item(nNodeCount).name !== “PrintButton”) {
    oFields.item(nNodeCount).access = “readOnly”;
    }
    }
    }
    FinalizeForm.presence = “hidden”;
    app.execMenuItem(“SaveAs”);

  58. Had to change script based state-change properties to automatic. Works great now. Thanks for the help!

  59. Can I do this without LiveCycle?

  60. I use the code above but when I email the PDF it can still be edited by the reciever. Can you share what you did for the other poster with that issue?

  61. thanks Girish! I emailed the form to mergeandfuse@gmail.com

  62. hi,
    I have a signature field and submit button in my Form. Intially Submit button is invisible.When the user sign the form, i have to validate the form. I don’t know how to validate the signature field. please help. if the form is valid, i have to show the Submit button.

  63. hi
    I would like to know where the script should be saved for disabling drop down fields while submitting the form through email

  64. Is there a way to make my buttons invisable once the document is sent in e-mail as a pdf. I can make them screen only and they will not print but they show up on the pdf. These buttons are only needed prior to sending the form to the customer and being visable is rendering the form to complicated.

  65. Just started using the Lifecycle designer and a really basic user. Your help on creating a button that emails the entire form as pdf was excellent. Made my day. It perfects what we wanted. Thank you soooooo much. 🙂

  66. Hi Girish. I am also having a problem with my form and the script, where the fields remain editable. What can I do to remedy this?

    Thanks!

  67. Hi Girish,

    I have created an Invoice form in LiveCycle Designer ES. It is designed to be filled out by our techs and then they email it to the customer for an approval by them by adding their initals in one field and then be emailed back to accounts receivable person.

    How do I lock the fields once the techs fill them out and submit the form via email, but not lock the initial field to be filled out by the customer.

    btw, this thread has been very informative and you have a lot of in depth information, that is hard to find on the internet. Do you have a website that you have other postings about LiveCycle?

    • Hi
      Look at the script with the pdf form associated with this blog post. You can enable the required field at the end of the script
      thanks
      girish

  68. I have read your post and copied the script but I can not get the fields to be locked after submit by email. The button already has a script to a prefilled email address and subject line from a field using post submit and I tried adding the code to it and also as a mouse down.

    Any help would be appreciated.

    Thanks,
    Greg

  69. Thank you so much….I have spent hours trying to get it to work! FYI….the form in the mail to field goes to our general mailbox using our exchange server name since the form is on our intranet.

    Thank you again,

    Greg

  70. It works! Thank you so much for your help.

    So that I know…you hide the submit by email button that had the click event and created the new submit button which has the lock fields and to click the hidden button on the mouse down event.

    Also did you modify the script to get the date field working?

    Thanks,

    Greg

  71. I am having a problem making my form read only. I put the script you specified into the “mouseDown” event, with the addition of the script to hide the button upon submission. The read only part was working, but only while the form was saved as “static”, and the button never went into hiding. I needed to save the form as “dynamic” to get another feature with script to work, and now your code is not working. Any help?

  72. Hi!

    I need a script like this but then for Acrobat 9 since we are designing forms in Acrobat but not Lifecycle. It’s not a solution to switch to LC…

    What I found out is that the xfa-object should be replaced with an acroform-object, but then the whole code changes and it’s way too complicted for me as I have a rather limited code knownledge.

    Can anyone port the script to Acrobat-compatible js?
    Thanks for helping me out 🙂

  73. I am setting up new PDF form to have a submit button to e mail. I figured out to get the new email to come up and send it, but on the receiving end I would like to have the button be invisable and to have the form be locked, I looked through the script you have on this site but can not get it to work for my form. I am using tables with text boxes in them, maybe this is my problem, please help.

  74. I cant seem to get this to work completely in a dynamic form. saving the form works but it will not disable all fields. is there something different that needs to be done?

    • Hi
      I have sent you a sample form, take a look at it
      thanks
      girish

    • do the following
      open the form in Adobe LiveCycle designer
      File | Form Properties
      Click on the defaults tab
      In the scripting section select “Automatically” radio button
      save the form

  75. Hi Girish,

    Using your code, I want to be able to control the subject and message body (I have already populated these into variables based on input on the form).

    How can I do this?

    I have tried a number of options:
    – placing your code in the mouse down event, then performing a “event.target.mailDoc” in the mouse up
    – placing your code in the click event, then following your code with “Button1.execEvent(“click”);” which then does “event.target.mailDoc” in button1 click

    Both of these (any other combination) still give me an editable copy of the PDF.

    Any ideas?

    Thanks,
    reubz.

    • Hi
      I have sent you a form, take a look at it
      thanks
      girish

      • Thanks for your email. I have added the code to my form but still getting an editable PDF.

        I have emailed you my form if you are able to look at it.

        Thanks,
        reubz.

    • Try doing the following
      open the form in Adobe LiveCycle designer
      File | Form Properties
      Click on the defaults tab
      In the scripting section select “Automatically” radio button
      save the form

  76. Jonathan Hunkapiller

    I’m having a hard time with this. I have acrobat 8 pro. I added the javascript to the email button, but i’m having trouble with the .xdp file not sure what to do with that. I have made this form for my co-workers. the idea is we fill in the information on this purchase order form, but when we send it via email to the company we want to order products from, we want them to be able to see the content we filled in, but we don’t want them to edit it.

    • Hi Jonathan
      .xdp is the file you create when creating forms, You can save the .xdp as pdf after you have done adding the javascript to the e-mail button
      Also please follow the following steps after adding the javascript
      open the form in Adobe LiveCycle designer
      File | Form Properties
      Click on the defaults tab
      In the scripting section select “Automatically” radio button
      save the form

      Let me know or send me your form
      girish
      mergeandfuse@gmail.com

  77. Is there any way to tell it which fields NOT to lock. I have a form with 50 or so fields. The last 2 on the form are for the customer name and an electronic signature.

    I want employees to be able to fill in customer data, click the sumbit button and send the contract to a customer with all info locked BUT the esig and other field. Then they’ll be able to send it back to us.

    Any help will be appreciated.

  78. Hi, I am facing a problem, i ma using a table in which there are 200 cells having different values in the cells.I want to check for a particular number that in which cell it falls.
    Please Help me.

  79. Grish,

    I really like the work you do and how you help people out. I am using the lock feature on form now but I am running into some problems. I have the form set up to lock when it is submitted, which is great. But now I am trying to unlock some of the forms but cannot.

    Is there a way the form can be unlocked once it is locked? Either a program on the internet or something in Acrobat?

  80. Hi,

    i’ve tried your script on the Mouse Down event, and i’ve enabled user rights when i opened my pdf in Acrobat. however when i test this, i send the pdf to myself and fill the fields, hit the submit button and it tells me there’s a syntax error in the script. the error says line 1 “next to” column 5 which corresponds with the first instance of “var”…
    i haven’t done anything with the xsd you provide in attachment – is there something more i’m missing?

  81. Hi Girish

    thanks for your reply…by reading the full list of posts i found i had made the same simple mistake as Spikyles – i forgot to select Javascript…

  82. Hello everyone, this discussion centers on what I would like to do… namely lock all fields after submitting or saving as. I am using Acrobat Pro and very new to all of this. Can anyone provide step by step instructions?

  83. Hi there
    I have created a “product specs” template using LiveCycle designer. I have a button on the form which Saves the form as a .pdf. However, I require this button to first LOCK all of the fields on the form, so that the “saved” pdf document is not editable or fillable.
    Please could you assist me with a script perhaps which could be assigned to a button, so we can lock the form fields before saving? Thank you

  84. I created a form which enables users to submit via email. Do you know if it is possible to have the form exit out without saving right after the form has been attached to an email? Right now, once the users fills in the form, clicks on the submit via email, Outlook opens with the PDF attachment all filled. After the users sends the form, they then have to go back into the original PDF document, close it out without saving. I basically want to prevent the users from saving the document because many users need to use it, and it must remain empty for each user.

  85. I want to password protect a drop-down field only. I want to change the fee before I send out the document and not let the received change the fee from the drop-down box. Is this possible?

    • I am not sure if you can password protect a specific field. You can hide/disable the field but I do not know what you mean by “Password protecting the field”
      thanks
      girish

  86. Thx for your solution. For several hours, i’m searching for a solution to prevent users editing their filled out and sent forms. Now it works fine.

    Great work.

  87. I’m trying to disable all filled in text fields once they are submitted. in this message string I found the code but do not know where to put it. Will is work in Script editor or do I insert in the xml code for the submit button?

    Newbie here don’t know exactly how this works, please help!

  88. I don’t understand how this file can be of use if it is password protected from me. what is the password? How else can I see your code? What you claim this form does is exactly what I need.

    • Girish Bedekar

      Hi
      the xdp file and the associated javascript are added as attachments to the PDF. So when you open the PDF file, click the paper clip icon to open the associated PDF attachments. save the attachments to your local drive, and you should be able to open them without any problem.
      Let me know if you have any problems
      thanks
      girish

  89. HI Girish,

    Thanks for this code, we are having some issue with it. We have a form with 10 mandatory fields. We add the code to the MouseDown of the button but i f the user clicks and there are fields still incomplete the form is locked!

    the code is here:

    for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
    var oFields = xfa.layout.pageContent(nPageCount, "field");
    var nNodesLength = oFields.length;
    // Set the field property.
    for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
    oFields.item(nNodeCount).access = "readOnly";
    }
    }
    this.presence = "hidden";

    is there a way to enable the debugger for mandatory fields then submit the form and then lock the fields and buttons?

    thanks

    • Hi
      In the code you will have to look for some of your mandatory fields property and mark them as read only if they have values filled in them
      The code above is just a starting point to get you started
      Thanks
      girish

  90. Hi Girish.. i have a question with regards to PDF form.. i have created a form and distributed the same… now, when the receipient fills the form and submit using submit button, they should not get any popups or open an email message to send… the filled PDF form should be simply submitted by their end. Is there a syntax or code for this?? if yes, can you please provide me the same and the place i need to place.

    Also, is there is a code for getting an acknolwedgement email for the sender after they fill the form??

    Thanks,
    Kingsly

    • so you want them to submit the form via email but not open any popups. The popups will only open the first time, and then they choose the option to not show the popups
      AFA acknowledgement is concerned, you could use outlook feature to send the sender a notification after the recipient has opened the mail
      thanks
      girish

  91. Need to know how to hide buttons in the form that is e-mailed. Keeping the form on the computer desktop with live buttons.

  92. Hope I can get a response soon. I’m anxious to get this form up and running.

  93. Never mind! I found a way around it using Script editor and Action Builder.

  94. Now that I conquered that issue. My boss wants me to have 2 of the fillable text fields automatically populate the subject line of the e-mail.

    Can you help with that? So glad I found this forum. Thanks!

  95. Oops now they;ve added another task get the file size down from 2MBs. Any help on this iand the previous question would be greatly appreciated.

  96. Hi Girish,

    I am a newbie to LiveCycle as well as javascipt. The code you supplied above works great!

    I have radio buttons and a text field on my form. I would like the text field to stay active after emailing but still have the radio buttons be disabled. Is there a simple code like above you could provide me to accomplish this?

    Thank you,

  97. I created a fillable PDF form in Livecycle Designer ES2 with a “Submit by Email” button. The form works perfectly with two exceptions.
    The first is that like many people above, I would like the attachment to be read only when it is received. I have tried my best to follow the instructions above but when I copied the script into my XML Source tab at the bottom and then tried to save I get an error that says: Xml parsing error:junk after document element (error code 9), line 3014, column 1 of file. Any suggestions?

    The second is I would like the users of this form to not be able to save any data in my original, but it escapes me as how to do this.

    I would appreciate any help.

    Thank you,
    Carmen

Leave a reply to Christian Cancel reply