PDF Forms JavaScript Help

Hello,
I've learned the hard way that JavaScript in forms may not work on tablets (across various OS). I have two custom calculation scripts running in my form, and was wondering if there's another way to write them, or a work around, to where it would work on tablets (I'm no JavaScript expert!)?
I have one calculation that counts the number of check boxes in a list (check boxes 20-31) that are checked:
var total = 0;
for (var i=20; i<=31; i++) {
if (this.getField("Check Box"+i).value!="Off") total++;
event.value = total;
From that, I have another calculation that returns a value in another field based on the number of check boxes checked:
var a = this.getField("Check Box Count").valueAsString;
event.value = "";
if (a=="1") event.value = "0.00";
if (a=="2") event.value = "300.00";
if (a=="3") event.value = "300.00";
if (a=="4") event.value = "300.00";
if (a=="5") event.value = "300.00";
if (a=="6") event.value = "300.00";
if (a=="7") event.value = "300.00";
if (a=="8") event.value = "300.00";
if (a=="9") event.value = "300.00";
if (a=="10") event.value = "300.00";
if (a=="11") event.value = "300.00";
if (a=="12") event.value = "300.00";
I don't know which of the two, or both, is the issue. Is there a work around I could use?
Many many thanks in advance for any help!!

Do you mean update the full script to the below? I tried that and unfortunately it didn't work. Am I missing a command somewhere?
Thanks!
var a = this.getField("Check Box Count");
event.value = "";
if (a==1) event.value = "0.00";
if (a==2) event.value = "300.00";
if (a==3) event.value = "300.00";
if (a==4) event.value = "300.00";
if (a==5) event.value = "300.00";
if (a==6) event.value = "300.00";
if (a==7) event.value = "300.00";
if (a==8) event.value = "300.00";
if (a==9) event.value = "300.00";
if (a==10) event.value = "300.00";
if (a==11) event.value = "300.00";
if (a==12) event.value = "300.00";

Similar Messages

  • PDF Form javascript for making readonly field by using button

    Please let me know the PDF Form JavaScript for making selected fields(Text field,Drop down list,..) as read-only by using Button.

    Do you want your button to be made read only?
    One starts with Acrobat JS Reference.
    // make all fields in a form read only;
    var oField; // variable for field being processed;
    // loop through the form fields;
    for (var i = 0; i < this.numFields; i++) {
    // process each field name;
    oField = this.getField(this.getNthFieldName(i)).readonly = true;

  • PDF Form Javascript for getting User LoginName

    Please let me know PDF Form JavaScript for showing User Login Name (login id) in the Text Field (text1), when using Button (button1).

    As noted there has to be a special folder level script installed on each user's system. This script can be written to access individual properties of the identity object or only a specific property. One can also create a function to access the identity object or even create new properties.

  • J_3R_INV1_CONTEXT or J_3R_INV1 PDF form need help

    Hello All!
    Help me please!
    When I try to PDF print of PDF form INV-1, the subtotal on first page is incorect. becose qty * prise is incorect. qty = 1 but report do: qty = 1000 & all other data in report is incorect.
    How i can try to correct this?

    First of all sorry of my bad english.
    On Page 1 in table on column 12 qty = 1, on Page 2 in first row (a)
    Write &#1054;&#1044;&#1048;&#1053; (in russian one or 1), in second row (&#1041;) write &#1054;&#1044;&#1053;&#1040; &#1058;&#1067;&#1057;&#1071;&#1063;&#1040; (in russian 1000) but it's incorrect.
    row (&#1042;) = row(a) * price. I need row (B) = 1Price but i have 1000Price.

  • Adobe upgrade - lost all saved data on pdf form. Help?

    I recently spent weeks completing and revising a very lengthy and important application form (pdf).  Upon submitting it I was told that the data could not be viewed and that I needed to update my Adobe to the latest version (11).  Upon doing this I lost all saved data on the pdf forms, I wasn't pre warned about this and am extremely dissapointed as it tooks me ages to find all the information and re-word it to a high standard.  Is there any way that it can be recovered? 
    I thought it would be in my sent emails but that is blank as well.  Help?

    If you used an earlier version of Reader before it would only have been possible to save the filled-in information in the file if a special right was applied to it by the authors, before you received it. If that right was not applied then you should have seen an error message saying that the file can't be saved with the data you entered.

  • LiveCycle/PDF Forms Submission Help

    Hello all,
      I've recently been tasked with updating the website for my employer, a County Public Safety Department in PA.  We currently accept forms from a number of other departments in all forms.  Some come via FAX, some email, etc.  We're trying to simplify the process and put all of the available forms on our website, and allowing them to be submitted electronically.  My boss wanted me to look into FDF, but it seems that is a bit outdated.
    At this point, I simply need some help determining exactly what software I need.
    I need to have a multitude of documents available on the website and once filled out, they need to go to a myriad of people.  I see an email submission is fairly easy, but as this is government, they want things sent to several people and logged in a central location.  What software do I need on the server to accept the documents?  They don't neccesarily need to go into a DB, but that option is available.
    Thanks
    jdestefano911

    Hi,
    If considering PDF forms, then it is important to consider what software the user will have to open/fill in/submit these forms, e.g. Acrobat or Reader or third party PDF viewers.
    Before you deploy a form you can entend its functionality for users with Reader. If you don't do this, users with Reader will only be able to submit by http.
    Here is a summary of deployment options and the features/restrictions in each case: http://assure.ly/etkFNU. Click the link at the end of the post for the summary.
    If processing a lot of data then it may be worthwhile considering components from LiveCycle Enterprise Suite. http://www.adobe.com/products/livecycle/. Particularly when requiring logging of interactions and a workflow with different outcomes.
    Maybe talk to an Adobe rep in your area.
    Hope that helps,
    Niall

  • No submit button in distributed form - JavaScript help

    I have creted a from in Live Cycle Designer. After distribution submit button is not visible in Acrobat and Reader. I've looked at the form JavaScript and find out this part of code which probably hide submit button in Acrobat 9:
    showAutoGenSubmitBtn = function(bShow)
        var autoGenSubmitName = "%AUTO_GEN_SUBMIT_NAME%";
        var fld = this.getField(autoGenSubmitName);
        if (fld != null)
            var b= this.dirty;
            if (bShow)
                fld.display = display.noPrint;
            else
                fld.display = display.hidden;
            this.dirty= b;
    // Hide the auto-generated submit button for Acrobat/Reader >= 9.0
    if (app.viewerVersion >= 9)
        showAutoGenSubmitBtn(false);
    else
        showAutoGenSubmitBtn(true);
    I am not familair with JavaScript so I would apprecite if someone can help me how to edit it to make submit button visible.
    Below is a complete JaveScrip of mentioned form.
    Thanks
    //@@FORMSWORKFLOW auto-generated script
    AdobePatentID="B643"
    var AdobePatentID = "AdobePatentID=\"B643\"";
    // Show a dialog to ask the user's name and email during submit.
    askUserIdentity = function(doc)
        // string constants
        var dlgStrings =
            sDlgTitle:          "Send Form",
            sEmailLabel:        "&Email Address:",
            sNameLabel:         "Full &Name:",
            sSubmitLabel:       "&Send",
            sToLabel:           "To:",
            sSubjectLabel:      "Subject:",
            sSubjectContent:    "Submitting Completed Form",
            sAttachmentLabel:   "Attachment:",
            sFromLabel:         "From:",
            sErrorEmailRequired:"Please enter a valid email address.",
            sErrorNameRequired: "Please enter your name."
        var dlgElems = [];
        dlgElems[dlgElems.length] = {
            type: "view",
            align_children: "align_left",
            elements:
                    type: "view",
                    align_children: "align_row",
                    elements:
                            type: "static_text",
                            name: dlgStrings.sToLabel,
                            width: 80,
                            bold: true,
                            font: "dialog"
                            type: "static_text",
                            item_id: "sdto",
                            width: 270,
                            font: "dialog"
                    type: "view",
                    align_children: "align_row",
                    elements:
                            type: "static_text",
                            name: dlgStrings.sSubjectLabel,
                            bold: true,
                            width: 80,
                            font: "dialog"
                            type: "static_text",
                            name: dlgStrings.sSubjectContent,
                            width: 270,
                            font: "dialog"
                    type: "view",
                    align_children: "align_row",
                    elements:
                            type: "static_text",
                            name: dlgStrings.sAttachmentLabel,
                            bold: true,
                            width: 80,
                            font: "dialog"
                            type: "static_text",
                            item_id: "atch",
                            width: 270,
                            font: "dialog"
                    type: "gap",
                    height: 5,
                    width: 350
                    type: "static_text",
                    name: dlgStrings.sFromLabel,
                    bold: true,
                    font: "dialog"
                    type: "static_text",
                    name: dlgStrings.sEmailLabel,
                    bold: true,
                    font: "dialog"
                    type: "edit_text",
                    item_id: "emal",
                    width: 250
                    type: "static_text",
                    name: dlgStrings.sNameLabel,
                    bold: true,
                    font: "dialog"
                    type: "edit_text",
                    item_id: "name",
                    width: 250
                    type: "gap",
                    height: 5,
                    width: 350
                    type: "ok_cancel",
                    ok_name: dlgStrings.sSubmitLabel
        var desc = {
            resourceContext: "AcroForm",
            description:  {
                name: dlgStrings.sDlgTitle,
                elements: [
                        type: "view",
                        align_children: "align_left",
                        elements: dlgElems
        desc.initialize = function(dialog)
            var METADATA_ANNOT_NAME = "adhocFormState";
            var PROP_INITIATOR = "initiator";
            var initiator;
            var annot = doc.getAnnot(0, METADATA_ANNOT_NAME);
            if (annot != null) {
                var arrProps = new Array();
                arrProps = annot.contents.split(";");
                initiator = getProperty(arrProps, PROP_INITIATOR);
            var decodedFileName = unescape(doc.documentFileName);
            var initVars =
                sdto: initiator,
                atch: decodedFileName
            dialog.load(initVars);
        desc.validate = function(dialog)
            var values = dialog.store();
            if (values.emal == "") {
                app.alert(dlgStrings.sErrorEmailRequired);
                return false;
            if (values.name == "") {
                app.alert(dlgStrings.sErrorNameRequired);
                return false;
            return true;
        desc.commit = function(dialog)
            this.result = new Object;
            var values = dialog.store();
            this.result.name = values.name;
            this.result.email = values.emal;
        var ret = app.execDialog(desc);
        if (ret == "ok")
            return desc.result;
        else
            return null;
    askEmailClient = function(doc)
    // string constants
        var dlgStrings =
            sDlgTitle:      "Select Email Client",
            sDlgText:       "Please indicate the option which best describes how you send mail.",
            sDesktop:       "&Desktop Email Application",
            sDesktopDesc:   "Choose this option if you currently use an email application such as Microsoft Outlook Express, Microsoft Outlook, Eudora, or Mail.",
            sInternet:      "&Internet Email",
            sInternetDesc:  "Choose this option if you currently use an Internet email service such as Yahoo or Microsoft Hotmail. You will then need to save your form and return it manually to [email protected] using your Internet email service."
        var dlgElems = [];
        dlgElems[dlgElems.length] = {
            type: "view",
            align_children: "align_left",
            alignment: "align_fill",
            elements:
                    type: "static_text",
                    name: dlgStrings.sDlgText,
                    width: 350,               
                    font: "dialog"
                    type: "radio",
                    name: dlgStrings.sDesktop,
                    item_id: "rad1",
                    group_id: "rgrp",
                    bold: true,
                    font: "dialog"
                    type: "view",
                    align_children: "align_top",
                    elements:
                            type: "gap",
                            width: 20
                            type: "static_text",
                            name: dlgStrings.sDesktopDesc,
                            wrap_name: true,
                            width: 342,
                            font: "dialog"
                    type: "radio",
                    name: dlgStrings.sInternet,
                    item_id: "rad2",
                    group_id: "rgrp",
                    bold: true,
                    font: "dialog"
                    type: "view",
                    align_children: "align_top",
                    elements:
                            type: "gap",
                            width: 20
                            type: "static_text",
                            name: dlgStrings.sInternetDesc,
                            wrap_name: true,
                            width: 342,
                            font: "dialog"
                    type: "gap",
                    height: 5,
                    width: 350
                    type: "ok_cancel",
        var desc = {
            resourceContext: "AcroForm",
            description:  {
                name: dlgStrings.sDlgTitle,
                width: 250,
                elements: [
                        type: "view",
                        align_children: "align_left",
                        elements: dlgElems
        desc.commit = function(dialog)
            this.result = new Object;
            var values = dialog.store();
            this.result.send = values.rad1;
            this.result.save = values.rad2;
        var ret = app.execDialog(desc);
        if (ret == "ok")
            return desc.result;
        else
            return null;           
    AdobePatentID="B643"
    // set a new property value to a property in the specified array.
    setProperty = function(arrProps, propName, propValue)
        var i;
        var bSet = false;
        for (i = 0; i < arrProps.length; i++) {
            var propParts = new Array();
            propParts = arrProps[i].split(":");
            if (propParts[0] == propName) {
                propParts[1] = propValue;
                arrProps[i] = propParts.join(":");
                bSet = true;
                break;
        if (!bSet)
            arrProps[arrProps.length] = propName + ":" + propValue;
    AdobePatentID="B643"
    // get the value for a property in the specified array.
    getProperty = function(arrProps, propName)
        var i;
        for (i = 0; i < arrProps.length; i++) {
            var propParts = new Array();
            propParts = arrProps[i].split(":");
            if (propParts[0] == propName) {
                return propParts[1];
        return null;
    AdobePatentID="B643"
    showAutoGenSubmitBtn = function(bShow)
        var autoGenSubmitName = "%AUTO_GEN_SUBMIT_NAME%";
        var fld = this.getField(autoGenSubmitName);
        if (fld != null)
            var b= this.dirty;
            if (bShow)
                fld.display = display.noPrint;
            else
                fld.display = display.hidden;
            this.dirty= b;
    // Hide the auto-generated submit button for Acrobat/Reader >= 9.0
    if (app.viewerVersion >= 9)
        showAutoGenSubmitBtn(false);
    else
        showAutoGenSubmitBtn(true);

    I'm distributing the form in Acrobat Pro 9.
    I created the form in Live Cycle Designer.  Save, then open in Acrobat pro.  Extend Features to Acrobat Reader, click the drop down box on Forms and hit distribute.  I save a local copy.  When I open the distributed form the buttons do fall silent, the Submit Button on the purple line up top still works, but that doesn't appear in reader and the people who will be completing the form all use reader.  Any suggestions for a fix?
    I'd like to distribute because that automates the tracking.  It works undistributed.

  • PDF form javascript time help needed

    I am creating a fillable form using time formats and I need help with 2 parts. First part is at the top. I would like the total time to display in hours. It should take total loaded departed minus total loaded arrived time and total it into the first Total Time box as hours but I can only get it to display as a number. Every time I tried to format it as a time it would give me an error.
    Second part I need help with is down toward the bottom. It's called 030-LOAD DELAY. This will also display as a time format. It will take that top Loaded Time Total and subtract an hour. How do I do that?
    I have been googling for hours and hours on this. There's so many ways to do this but every time I try different ways, it doesn't work and I end up confusing myself even more.
    (and btw, I'm using acrobat version 9)

    Ok. I finally got the calculations to work. But..... when I save and open in Reader, they don't work. Go back to Pro, they don't work there now either. They also don't show up under the Set Field Order Calculations. To reset them, i have to erase the calculations, save, redo the calculations. Preview the form and everything works — calculations happen and i get a total.
    Adobe Reader usage rights are enabled.
    Why is this so hard?
    I found this thread http://forums.adobe.com/message/1152890#1152890 about it. Is this bug still going on since 2009?
    Ok. Apparently you have to enable reader rights after the form is done. It seems to work now. What a pain.

  • Getting data to show from context in adobe pdf form - Please help

    Friends,
    I need to get data passed to pdf based print form.
    Here are the steps i perfomed to bring the data to the form:
    1) created adobe form layout and context in sfp tcode
    2) created interface in sfp tcode. used a copy of a standard sap interface with the code initialization intact.
    3) dragged fields from interface to context
    4) did default binding in object palette of the form fields in the layout to the respective fields from context
    still, the data is not getting displayed in the form layout when the form is executed, whereas it is getting displayed in the standard form.
    Am I missing something here... Please help me as this is urgent.
    Points will be rewarded for helpful answers.
    Regards,
    John.

    Solved

  • How to get pdf form data into a php code?

    I have created one pdf form ,that helps to fill application form online.....
    I tried to access the field values using php code ($_REQUEST) but itz not taking any field values then i searched everywer to find solution but all are telling the same .then i got one link for demo of simple submit form , here is the demo http://blogs.adobe.com/stevex/files/SimpleSubmitSample.pdf but this demo is not working in my system,not getting values from pdf ........................Is there any setting to do inorder to get pdf form field values in PHP
    can any one help me??

    I never had this problem so obviously something needs tweaking. First thing to test is to leave the PDF out of the picture - check if the variables are received when performing a HTTP POST from another web page to your script. If this works, the next step would be to have your script do a phpinfo(); or print_r($_POST); and submit from your PDF. This in order to determine what really is sent from the client.
    Now you should be able to pinpoint your problem.

  • Seeking Pdf form help - javascript formula to auto-populate fields based on data from other fields.

    Hi there, I am new to PDF form work, and am wondering if someone could help me with a javascript formula.
    I want to auto-populate the EXPIRYDATE field, as the same date as the entered AUTHORIZATIONDATE field, but 4 years later.
    So, I want to be able to enter 11/14/2014 in the AUTHORIZATIONDATE date, and have 11/14/2018 auto populate in the EXPIRYDATE field.
    Seems simple I know, but I've messed around quite a bit and can't seem to make it work. Is this possible??
    Any help would be very much appreciated!!

    And what have you done?
    This can only be done with custom JavaScript programing.
    The value of date type fields are text field and not numeric data. The first task is to convert the dates to a number on some type of number sequence that is a mapping to dates.
    Have you looked at the Acrobat JavaScript API Reference, the MDN JavaScript reference?
    I would use the Acrobat JavaScript util.scand to covert the date string to the number of milliseconds from January 1, 1970 midnight. and then use the getFullYear method of the date object for the year value and add 4 years to that value and then use the setFullYear method to set the year for the date object. Now you can use the util.printd method to format the date object as a date string with a specific format.
    // get the date value, format of date string and years to add;
    var cDate = "11/14/2014"; // date value;
    var cFormat = "mm/dd/yyyy"; // date format;
    var nYears = 4; // years to add;
    // convert date string to date object;
    var oDate = util.scand(cFormat, cDate);
    if(oDate == null) {
    app.alert("Error converting " + cDate + " using format " + cFormat, 0, 1);
    // add years to date object;
    oDate.setFullYear(oDate.getFullYear() + nYears);
    // display result;
    var cExpireyDate = util.printd(cFormat, oDate);
    app.alert("Authorization Date: " + cDate + "." +
    "\nExpire Date: " + cExpireyDate, 3, 0);

  • How to seperate current page fields in a pdf form using javascript

    Hi,
    Is that possible to seperate current page fields(textbox, Chesckbox) in a pdf form using javascript.
    I have coding to get all the fields in a pdf form. But i want to take CURRENT PAGE alone.
    Please help me out.
    Thanks and regards,
    Christy

    Hi try67,
    Thanks for your support.
    I got the result.
    Thanks and Regards,
    Christy

  • Javascript window on submitting PDF form

    Hi,
    I have a form designed in Livecycle ES3. When I go to submit the PDF form using Adobe Reader 8.0 to the specified email address I get the following javascript window:
    To:
    Subject:
    Attachment:
    From:
    Email Address:
    Full Name:
    Warning:Javascript Window
    When I select Send I then get another javascript window:
    Please indicate the option which best describes how you send mail:
    Desktop Email Application
    Internet Email
    When I click ok it works fine and attaches to an outlook email. However I don't want these windows to appear at all but for it just to send the pdf.
    Is there some setting I need to change when designing the form in Livecycle or a setting in Adobe Reader?
    Any help appreciated.
    Thanks,
    Deep.

    any ideas? still can't get rid of this window?

  • Information about javascript in pdf forms

    Hello folks. Could anybody tell me where i can find information about application javascript language in pdf forms? I've visited adobe.com and found a lot of pdf articles but they are really useless. I want to find about object model of pdf form, about frequent used operators.

    Hi Konstantin,
    I think this could help you:
    LiveCycle Designer Scripting Basics http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf
    Adobe XML Form Object Model Reference: http://www.adobe.com/devnet/livecycle/articles/Adobe_XML_Form_Object_Model_Reference.pdf
    Michal

  • JavaScript issue in PDF Form

    I am wanting to create a script in a PDF form format with Adobe 8.0 (or 5.0 if necessary, what I want it to do is when I fill out a form box "name" on page 3 I have the same thing "name" is there a way for it to bring the information from the first box to the second without me retyping it? I will be using this form A LOT. I am working for a hospice center and have to fill out a ton of paperwork and some of it is very repetitive. Any help would be great, I know a little javascript and I think it can be done with it, any ideas?
    Nora

    If you are using Acrobat and the Form Tool, just use the same name for the field name.
    If you are using LiveCycle Designer, use the same name for the field name select "global" for the field's binding.

Maybe you are looking for

  • IOS8.1 Music App won't play "Skip When Shuffling" songs at all

    iTunes has two options for skipping a song during shuffle:  the first column with the tick box (let's call this the "Play Column"), and the "Skip When Shuffling" tick box in the Options tab of the song info. For songs in iTunes where the Play Column

  • F110 Payment Run Clarification

    Dear All Experts, In F110 transaction, due payment calculation is calculated on FI document posting date. I want to change this configuration. I want to calculate due payment on the basis of invoice date not on payment due date. is it possible?

  • X131e - weird browser tabs behaviour

    Hello all. Took delivery of an X131e a few days ago. OVer the past few days I have noticed an intermittent issue with the behaviour of tabs in both Explorer and the latest version of Firefox I installed. Essentially, what happens is that every time I

  • ABAP HR : Regular Run + Offcycle Run

    Please Help me.... With Regular run my offcycle payment is not getting summed. There are 3 situations. Transaction pc_payresult : Weekly 1. Regular payment for which offcycle is not carried out should not sum other offcycle payment. 2. If offcycle pa

  • Table containing relation between inv org and its OU

    Hi, IN Oracle which table conatins the information which will let us know that a certain Inventory Org belong a a ceratin OU. I actually need the OU name for an inv org... Thanks...