How to get an Adobe trusted function javascript to save a pdf form even if fields are empty?

I have a form I have created in Livecycle designer which I want to save to a specific location using a combination of specific fields in the form. I have been able to do this by writing a trusted function and putting it in the adobe javascript file and then putting some code on a save button in the form. However, it may be that some of the fields (vfirstname and vsecondname) may be blank and i still want the form to save. Ideally i want to write an if statement to substitute those fields for other fields if they are blank but cant get the code to  work.
Working code in trusted function file
// SaveAs Function1 var mySaveDoc = app.trustedFunction(function(doc) { app.beginPriv(); var vDate1 = event.target.xfa.resolveNode("form1.page1.Table1.Row1.leftsideofform.Timeanddate.Dateofca ll").rawValue.toString(); var vfirstname = event.target.xfa.resolveNode(" form1.page1.Table1.Row1.rightsideofform.Prospectiveclient.ClientFirstname").rawValue.toSt ring(); var vsecondname = event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Prospectiveclient.C lientsurname").rawValue.toString(); var myPath = "/MGLCC01-SV/MGPdata/Mihomecare/testce/" + vDate1 +"_" + vfirstname + "-" + vsecondname + ".pdf"; // saveAs is the only privileged code that needs to be enclosed doc.saveAs({cPath: myPath, bCopy: true, bPromptToOverwrite: true}); app.endPriv(); }); 
Working code on save button in form
form1.#pageSet[0].Newenquirymasterpage.Button1::mouseUp - (JavaScript, client) var txt = form1.execValidate(); //This script will validate all required fields event.target.mySaveDoc(event.target) xfa.host.messageBox("Document has been saved to shared drive", "File Saved", 3, 1); 
IF code for trusted function file that I cant get to work
// SaveAs Function1 var mySaveDoc = app.trustedFunction(function(doc) { app.beginPriv(); var vDate1 = event.target.xfa.resolveNode("form1.page1.Table1.Row1.leftsideofform.Timeanddate.Dateofca ll").rawValue.toString(); if (event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Prospectiveclient. ClientFirstname").rawValue == " ")      {          var vfirstname = event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Enquirer.EnquFirstn ame").rawValue.toString();      }      else      {          var vfirstname = event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Prospectiveclient.C lientFirstname").rawValue.toString();      }     if (event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Prospectiveclient. Clientsurname").rawValue == " ")      {          var vsecondname = event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Enquirer.Enqsurname ").rawValue.toString();      }      else      {          var vsecondname = event.target.xfa.resolveNode("form1.page1.Table1.Row1.rightsideofform.Prospectiveclient.C lientsurname").rawValue.toString();      } var myPath = "/MGLCC01-SV/MGPdata/Mihomecare/testce/" + vDate1 +"_" + vfirstname + "-" + vsecondname + ".pdf"; // saveAs is the only privileged code that needs to be enclosed doc.saveAs({cPath: myPath, bCopy: true, bPromptToOverwrite: true}); app.endPriv(); }); 
Can anyone suggest why the If code above doesn't work? or how i could get the form to submit even if the fields are blank?

It can also work if you certify the document and each user chooses to trust it to execute privileged JavaScript, which may be feasible in this setting. The method you'd use is doc.saveAs: http://livedocs.adobe.com/acrobat_sdk/9.1/Acrobat9_1_HTMLHelp/JS_API_AcroJS.88.524.html
Also, read the following tutorial: http://acrobatusers.com/tutorials/how-save-pdf-acrobat-javascript

Similar Messages

  • How to get the output of a standard report  RFBILA00 in PDF form.

    hi,
    I have to get the output of the standard report RFBILA00 in the PDF form.
    Thanks.

    Hi Rao,
    you can run your report RFBILA00 in background  and in background  job you can add one more step, next in that step you can add custom  report like zsubmit .
    job should be set like
    step1:  RFBILA00 with variant.
    Step2:  zsubmit report with variant.
    In Zsubmit report  you can  read, your first step spool using FM GET_JOB_RUNTIME_INFO
    and pass that spool  in the FM  CONVERT_ABAPSPOOLJOB_2_PDF.
    when second  report run in job  you can set your target like download in the server or  send email etc.
    Regards,
    Prasenjit

  • How to get the value from a JavaScript and send the same to Java file?

    Hi.
    How to get the value from a JavaScript (this JS is called when an action invoked) and send the value from the JS to a Java file?
    Thanks and regards,
    Leslie V

    Yes, I am trying with web application.
    In the below code, a variable 'message' carries the needed info. I would like to send this 'message' variable with the 'request'.
    How to send this 'message' with and to the 'request'?
    Thanks for the help :-)
    The actual JS code is:
    function productdeselection()
    var i=0;
    var j=0;
    var deselectedproduct = new Array(5);
    var message = "Are you sure to delete Product ";
    mvi=document.forms[0].MVI;
    mei=document.forms[0].MEI;
    lpi=document.forms[0].LPI;
    if(null != mvi)
    ++i;
    if(null != mei )
    ++i;
    if(null != lpi)
    ++i;
    if(null != mvi && mvi.checked)
    deselectedproduct[++j]="MVI?";
    if(null != mei && mei.checked)
    deselectedproduct[++j]="GAP?";
    if(null != lpi && lpi.checked)
    deselectedproduct[++j]="LPI?";
    if( 0!=j)
    if(i!=j)
    for (x=0; x<deselectedproduct.length; x++)
    if(null != deselectedproduct[x])
    message =message+ "-" +deselectedproduct[x];
    alert(message);
    else
    //alert(" You cannot remove all products!");
    return false;
    return true;
    }

  • How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central.

    How do I add a functional "submit button" to a pdf form in Adobe Acrobat Pro XI ? I created the pdf form in Adobe Forms Central. It's for an online Diet Questionnaire. After people complete the form I'd like them to click "SUBMIT" and the completed form will be emailed to me.

    This can be a bit confusing because Acrobat 11 comes with the desktop app that allows you to create simple PDF forms without having a FormsCentral account. Some people find this helpful, but you need to understand that when you generate the PDF form, it is Reader-enabled by Acrobat. In order to edit the form further in Acrobat, you have to create a non-enabled copy of the form. You do this in Acrobat by opening the form and selecting: File > Save a Copy
    and opening the copy. It is not opened automatically.
    You can now add a button and set it up to submit by email, either using a "Submit a form" action or the submitForm JavaScript method. You can set it up to include just the form data or the entire PDF, and will want to use a mailto type URL. Submitting the form to the FormsCentral server has a number of important advantages over email (much more reliable, more secure, etc.), so you might want to consider it.
    If the form needs to be saved with Reader versions prior to 11, then you will need to Reader-enable the document. In Acrobat 11 you do this by selecting: File > Save As Other > Reader Extended PDF > Enable More Tools

  • How do i make adobe emailer function?

    how do i make adobe emailer function?

    Here's what I found at the download site:
    Follow these steps to get started:
    You need to install the Creative Cloud app in order to install this Add-on
    Click "Get Creative Cloud App"
    Install a compatible app, if needed, and make sure to Sync files to Creative Cloud
    Turn on Files Sync when you've installed Creative Cloud app, your Add-on(s) will be automatically installed
    That's all the author has to say, other than he no longer has time to support any of his scripts.
    Because of new projects and a changing demand for my time, it will be necessary for me to move on to new projects at Adobe. For this reason I will no longer be able to support, or update many of my scripts and panels. Never fear! – I am releasing the source code for many of my programs and if you are a programmer then you can use this code to modify and change my scripts to meet your needs. If you are not a programmer then I recommend working with anyone on the list of programmers that I have supplied below. However! Let me make it clear that his code is not to be sold. This is an open and free source to be used for the good of humankind and Adobe Photoshop users around the world.
    May the source be with you...

  • How to get the selectOneRadio value in javascript

    Hi,
    I want the selectOneRadio value in javascript. Can anyone give us a solution how to get the selectOneRadio value to javascript from jspx page.
    Thanks,
    Eswari

    Hi,
    I assume you are talking about JDeveloper 10.1.3 in where there is no JavaScript API ADF Faces.Here you will have to use document.getElementById() to access the radio button component (which is a list component). You can look at the generated HTML for how the component and its ID look like.
    However, what is the usecase that you cannot handle in native JSF ?
    Frank

  • How to get Saved Selection list in javascript?

    Hello!
    Recently I met a little problem about save selection. I want to get saved selection list so that I can used in javascript. Now I have no ideals. Hope you tell me some useful information about how to get Saved Selection list in javascript!

    Mark is right, it's not possible.
    But do you know you can assign selection to a variable, and get back to it simply like this?
    var sel = app.selection;
    app.selection = null;
    /* your codes here
    app.selection = sel;

  • How do I remove adobe as my default setting to view PDFs?

    how do I remove adobe as my default setting to view PDFs?

    Click the PDF file (any one), now from the Finder Menu > File choose Get Info
    open the section like so, choose Preview (or whatever) and select Change All

  • How to get page one to animate only once in interactive pdf?

    how to get page one to animate only once in interactive pdf? I like when the document opens up in acrobat and the the page animations work but when I go to one of the pages and hit my designated home button it goes back to page one but it reloads again. As a user it would drive me crazy to have to wait for all of it to load......anyway to have that page one load once as the opening page?

    I don't think you really mean animations (unless you have a placed SWF file) because things created with the Animation panel don't work in PDF. Nonetheless, you're talking about some kind of interactivity which is set to happen On Page Load.
    So when you return to that page, of course the interactivity loads again.
    There isn't a On Page Load Once command.
    Perhaps you need to rethink why the interactivity is there. If it's important, maybe it should be triggered by a rollover or by clicking a button.

  • My mini died. bought one used from a friend... all of my songs and books are on my iPhone, and I cant figure out how to get them onto this new computer. this is frustrating. the things i really want are purchases I've made from itunes store... help

    My mini died. bought one used from a friend... all of my songs and books are on my iPhone, and I cant figure out how to get them onto this new computer. this is frustrating. the things i really want are purchases I've made from itunes store... help
    !!!!!

    Hey kevyg3,
    I was able to find an article that I believe will help you move your iTunes purchases from your iPhone over to your new computer:
    iTunes Store: Transferring purchases from your iOS device or iPod to a computer
    http://support.apple.com/kb/HT1848
    Hope this helps,
    David

  • How do i make adobe reader my default to open any pdf file

    how do i make adobe reader my default to open any pdf file?

    What is your current default?  If Adobe Acrobat (X or XI), you can set it in your preferences.
    If it's another program, reinstalling or repairing Adobe Reader will set it to the default program.

  • HT1414 how to get rid of the icloud backup message it stuck in there even trying tapping up the ok button

    how to get rid of the icloud backup message it stuck in there even trying tapping up the ok button. I even tried press and holding the power off button still doesnt work the red arrow slider appears on it...also theres no apple logo appears on it

    Don't hold the power button and try to use the off slider, hold the power and home buttons until you see the Apple logo, then release.

  • Can I  use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Can I use excel type functions embedded into an online pdf form, ie Qty x Price= total $

    Let me tell you what I am sure about and what I am not sure about:
    I am sure that I want to be able to sell my products online. The industrial market that I sell to usually do not allow the maintenance people that find me on the web, do not have the ability to use credit cards in a typical shopping cart format due to the higher prices that the equipment I sell costs and that most people call me up to 'request a formal quotation' to give to their purchasing depart. So, my bright idea is to create numerous pdf files with very specific url's to match the very specific items that I sell. (1) item per pdf. I am thinking that the advantage to skipping the shopping cart approach and allowing the customer to fill in the qty of items, which would be mulitpled by the price of the item (a constant #) and then hitting a apply button, that would calculate subtotal price. Discounts for the qty the customer inputs (qty of items inputted by customer would be discounted on a percentage x base price) and a refresh the screen. It would allow for SEO advantages from what I have seen in the past in my very vertical market. All forms would be setup using the same functionality, just images, alt text, urls, and readable text would change.
    What I don't know- which is alot, then how to calculate shipping costs. I have a weight per item, which can be added up. I saw an Adobe blog that allows UPS shipping cost to be programmed in. I don't know how dreamweaver works, which was what the blog mentioned would allow for this updated, instantanious interface with UPS and calculating real shipping costs to a specific zip code. Shipping cost would be fluff to this page. The main thing would be to do allow the customer to be able to fill in a qty of the specific item on the page, calculate a discount if / then type thing, be able to have customer email to purchasing dept or print. I would date stamp it with verbage that pricing is valid for XX days and if I could get a copy emailed to me that would be icing on the cake. I believe that this non static pdf would be something different then the current competion and that it would allow for 100's of quotes to be generated without customers having to wait 15 minutes to an hour for me to process the exact document that they are looking for.
    Hajeks

  • How do I purchase reader extensions to save a PDF form that has been filled out in Acrobat Reader?

    I have just discovered that in order to save a PDF form that has been electronically filled out in Acrobat Reader, that I have to purchase reader extensions to make this possible.  I would like to speak to someone about the price and how to purchase.
    I cannot find a phone number on your site, so I am hoping to get an answer from Adobe this way.
    Thanks,
    Chani

    Thanks everyone for responding.  I should have supplied more information.
    I was hired by my client to create PDF forms that can be downloaded from their website, filled out electronically in Acrobat Reader, and then saved (with all the form fields filled in) and emailed.
    I was supplied with scanned forms as the base for creating the form fields in Acrobat Pro.  These web visitors that will be filling out the forms and emailing them will only have Acrobat Reader, most likely.
    I created the forms in Acrobat Pro, and they worked great when I tested them ( in Acrobat Pro) - I could save the form field data.  However, my client has come back to me with numerous complaints from their web visitors - they cannot save the form once they have filled it out in Acrobat Reader and keep the data they have entered.  Instead, they have to print the form physically, scan it, and email it that way (kind of low tech for the year 2013, and not easy for these people).
    So, my end goal is to update these forms in Acrobat Pro so they can be filled out by folks only using Acrobat Reader and saved with the form field data intact.  Seems like a no-brainer that Acrobat Pro should have this capability without purchasing additional extensions.  However, in my research online, I have found several posts that suggest that purchasing "Reader Extensions" is the only way to enable Acrobat Pro to be able to do this.
    Can someone please clarify if I need to buy something to program these forms in Acrobat Pro to enable other people using Acrobat Reader to fill out these forms and save them with the form fields intact?
    If I do need to buy something, what is it exactly?  How do I find out clear, consise, specific information about buying it/the cost/the licensing?  I am a sole owner/employee of a graphic design firm and these forms are for my client, which is a locally-owned regional hospital.
    If this needs to move to the LiveCycle forum, fine, but I don't really know what that software is and since I'm only using Acrobat Pro (and the users, Acrobat Reader) I felt this was the appropriate place to post.
    Thanks for all of your responses!
    Chani

  • I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway inst

    I have Adobe Photoshop Elements 10 plus I create PDF files for work some are scan pdf docs. When I install Photoshop Elements 10 it DOES convert all the PDF files to Photoshop Elements-10 Docs. it even changes and shows the PSE-10 Icon. So I am alway installing PSE-10 or uninstalling it. If I send the  PDF file that has been automatically converted to a PSE-10 the person I send the file to can not open it because they do not have PSE-10. What can I do to stop PSE-10 from converting my PDF files? Don't tell me to upgrade PSE-10 I tried their on-line program and  it is too advance for a hobby photographer like myself and their Help Desk is impossible to reach.

    Hi,
    Can you please share the logs?
    You can use the Adobe  Log Collector tool (Log Collector Tool) and share the corresponding zip file @ [email protected]
    Thanks,
    Shikha

Maybe you are looking for

  • Lenovo Wireless Device Settings Window is missing, G580 (20150) Windows 8.1

    Since upgrading to 8.1 I have been unable to access the window to toggle wireless and bluetooth on and off. I reinstalled LEM and the airplane function returned, but not the window. Wireless works after I removed the Microsoft driver. I don't have a

  • Can`t Login to WAS/NWA (always redirected to login screen)

    Dear Gurus,                    We tried to implement SSO logon Tickets following [steps|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a0042af5-5406-2c10-f689-fcc3b2d13d2f], and now we can`t login to any netweaber tool (NWA, User

  • What is a good rate to Record at if you are doing something for someone big

    96? or 44.1 is fine....NOTE: im not doing like vocals really just the beat Message was edited by: KennaOkoye

  • Webservice call from outlook

    Hi, I need your suggestions on web services call from outlook. I have a requirement like where user will send a mail from outlook and it should trigger web-service in SAP. Also i dont want this webservice to be exposed for internet since both exchang

  • CR-23 to CR-43. Help Please.

    Hi All, I have just got a new car which is pre-wired with the CR-23 car kit for the 6020/21 phone. I have a 6280 phone and need to the change the cradle from the CR-23 to the CR-43. Is this just a straight swap? i.e will the connector which plugs int