Convert Javascript: switch(xfa.event.newText) to Formcalc Syntax

I was wondering if someone could provide me with the syntax for formcalc for the following javascript. This is used to hide or make visible 2 fields based on a value in a drop down list:
switch(xfa.event.newText) {
    case 'A - Approved':
        form1.Page1.2nd_Title.presence = "visible";
        form1.Page1.2nd_Signature.presence = "visible";
        break;
   default:
        form1.Page1.2nd_Title.presence = "hidden";
        form1.Page1.2nd_Signature.presence = "hidden";
        break;
Thanks,
Mallard27

Sorry, no simple switch-like statement in FormCalc, although there are convoluted ways to simulate it.  For your example the easiest is if/then/else:
if (xfa.event.newText == "A - Approved") then
     form1.Page1.TextField1.presence = "visible"
     form1.Page1.TextField2.presence = "visible"
else
     form1.Page1.TextField1.presence = "hidden"
     form1.Page1.TextField2.presence = "hidden"
endif
Also, not sure if you can have object names that start with a number, like "2nd_Title".

Similar Messages

  • Difference btwn xfa.event.change and xfa.event.newText pls?

    Hello
    I tried to figure out the difference between xfa.event.change and xfa.event.newText in google, but did not see any such!
    Pls. could you clariy my question that what is the differenvce between these 2 (xfa.event.change and xfa.event.newText)?
    Thank you

    Thank you. With out having much knowledge on JS, i wrote the below JS
    myFomr.Page2.mySubform21.myCheckBox211::exit - (JavaScript, client)
    // To  check this check box, bank acct # is must to enter by user
    if (this.rawValue == "X"){
    if ((xfa.resolveNode("myFomr.Page2.mySubform21.BankNumber").rawValue == null) || (xfa.resolveNode("myFomr.Page2.mySubform21.BankNumber").rawValue == "")) {
        xfa.event.change = "";
    My impression was, i can change a value (in the above case am unchecking the check box by populating it with ""/space) of any (text, check box, drop-down) field on the form explicitly by using this script
    (xfa.event.change = "";),
    i already placed in around 20 locations, so, pls. suggest me do i need to correct all these 20 locations, kind of risk/tediuos at this point or is it ok that leave as is?
    Thank you

  • Who to use "xfa.event.newText" for value and not text

    Hello,
    What is the righr method for returning the value from a "list".
    xfa.event.newText return's the texte value i want le value.
    exemple :
    Text = USA  Value=us
    Text=France Value=fr
    Thanks

    Hi,
    A sample is here: https://acrobat.com/#d=eBF-l8sBTVN6-jqDUDw6lA
    It shows how to access the display value and the bound value.
    Good luck,
    Niall

  • Convert Video Switch in Desktop Software

    What happens when I use  the convert video switch in the Desktop Software when I am syncing videos to and from playbook.  Having problems playing video clips tagged as AVI.  Get error message on Playbook when I go to play the clips.  Assuming not a true AVI or using a 3rd party codec or something along that line.  Will play on computers but not the Playbook.  Will the convert video switch in the Desktop Software solve the problem.  Tried to use but it appeared to start to "convert"  all videos in file to upload to Playbook so I cancelled.  Any suggestion?  Thanks, Brian 

    Am I the only one suffering this issue with the video transcoding?

  • Help with Javascript error in event handler slowing animation down.

    Hi all--
    I did an animated book cover for my publisher, Baen Books, but an error keeps coming up in my animation.  The actual animating can be viewed here:
    http://baen.com/310x204/A_CallToDuty.html
    As you can see, when the error pops up, the animation grinds to a halt, an it has to recover.  I am not well enough versed in javascript to know what is going on. The error code below repeats over and over again as it plays.
    6Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:171
    3
    <error> VM26:184
    Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:1714Javascript error in event handler! Event Type = timeline edge.3.0.0.min.js:1713
    <error>
    If anyone has an idea what is causing this, I would be extremely grateful for  any help.
    David Mattingly

    Hi Hemanth--
    I put it in a dropbox folder for you here:
    Dropbox - EdgeAnimation
    This contains 2 versions--a small one for the preview, and then a larger one when people click on the cover preview. Thanks in advance for your help.\
    David Mattingly

  • Javascript error in event handler! edge 4.0.0.js, what to do about it?

    Site
    Hello everyone. I get an error in my chrome cosole, what can I do about this?
    I dont have this problem in all browsers, just in chrome, and in some versions of Firefox.
    The problem occurs when I click any label in the iframe (see website, speaks for itself).
    line 5838      window.console.log("Javascript error in event handler! Event Type = " + eventType);
    does anyone know how to fix this?
    And why do I only have this problem in some browsers?

    I basically want the labels in the Iframe to make the parent page animate to a specific anchor tag.
    ps. This is what I posted on the jquery forum as well:
    I tried to do this by letting the iframe .trigger a .click to a button on the .parent page.
    I did this in two ways.
    one: the click is triggerd in (/by) the iframe
    two: the click is triggerd by a script in the parent window, that script is launched by the iframe
    Here's the thing:
    this is what one of the <a>'s that the iframe will click looks like:
    <a class="nonblock nontext anim_swing" id="u185" href="index.html#contact"><!-- simple frame --></a>
    The code is generated by adobe muse which has a function to smoothly scroll to a location on the page, and I am guessing the "anim_swing" class takes care of that.
    I would like the colorful labels in the iframe to do the same thing as the <a> above.
    and it works in some browsers on some computers but somehow not on all of them (with method two the adblocker doesn't seem to be an issue ).
    I also tried to let the parent page scroll directly with the jquery .scrollto function. That did not work either (see the jquery forum).

  • Javascript error in event handler event type = timeline

    Hi,
    I have a small EdgeAnimate projekt with version 1.5.0 and the local export works fine... I must include the package at a CMS and I update all paths to absolute paths and all files are loading...
    but I the animation dont play - I see at the javascript console the follow output
    javascript error in event handler event type = timeline   edge.1.5.0.min.js:143
    Springender Punkt: Rettungswagen - Der springende Punkt
    I dont found any solution... :-((

    Hi Scott,
    I have gone through your shared composition created in older verion of Edge.
    If you open the older composition html page in browser, there already have some of the error messages in the console as you mentioned above like
          Javascript error in event handler! Event Type = timeline.
    And as you said with the latest Edge, when you upgrade the old composition, some new error messages gets added to the existing ones.
    As in the latest Edge, the whole of runtime has been shake-up, some of the attributes has been removed and are added in different way.
    Example: To access timelines of a symbol:
         Old way:           sym.timelines['Default Timeline']
         New way:          sym.data[sym.name].timeline
    You need to make some modifications in index_edgeActions.js file like:
         1. Search & Replace "timelines['Default Timeline']" with "data[sym.name].timeline"
         2. And in the code taken from EdgeCommons.js, replace "getVariable("symbolSelector")" with "_variables["symbolSelector"]".
    Hope, these changes will remove the new JS issues you mentioned.
    hth,
    Vivekuma

  • Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]

    I'm doing a little edge project (now in beta version) for my girlfriend (she hates the code), with examples of the animate() method and other functions like setInteval(), but when I run I get the following error in Chrome console:
    Javascript error in event handler! Event Type = element [edge.2.0.0.min.js:162]
    But this library is global for all projects, how is possible that trigger an error?
    Example here:
    https://app.box.com/s/m7nof4al6597gfn47jlu
    Thanks.

    you dont need to import java ease !!
    it's already included in edge animate, remove that yepnope completely your problem will gone
    Zaxist

  • Xfa.event.cancelAction cancels all subsequent actions

    I have created an expenses form which has a number of mandatory and optional fields.   To ensure no expenses are submitted with a value of 0, I have added a check which sets xfa.event.cancelAction = 1 on the presubmit event of my email submit button.  This works, but the problem is that it seems to cancel all subsequent actions too.  I have tried adding xfa.event.cancelAction = 0; in the postsubmit event, but this does not work.
    Does anyone have any ideas?
    Thanks, Paul

    Hi Paul,
    Put an extra visible button which will be your submit button.
    This "extra" button will do validations and all pre-submission checks.
    Once all checks have passed, then execute a "hidden" email submit button.
    Code Example:
    var formPassedValidations = false;
    <do all your validations here - eg: check if values are not zero>
    if (formPassedValidations == true)
         btnHiddenEmailSubmit.execEvent("click");
    else
         <show validation err message>
    hope this is what you are looking for... have fun!
    Regards,
    Luigi D'Amico
    8 BIT PLATOON
    design develop deploy
    www.8bitplatoon.com

  • Convert Javascript to Applescript

    Hi,
    I need to convert javascript to Apple script. Please help!!!
    try {
    app.activeDocument.layers.getByName( '.ARD' ).remove(); } catch (e) {};
    MOhan

    tell application "Adobe Illustrator"
              tell the current document
                        try
                                  delete (the first layer whose name is ".ARD")
                        end try
              end tell
    end tell
    It's always a help if you state the language choice in the question…
    Edit… a change of string filter
    tell a
    tell application "Adobe Illustrator"
              tell the current document
                        try
                                  delete (the first layer whose name ends with ".ARD")
                        end try
              end tell
    end tell

  • Issue with xfa.event.change in XFA 3.3

    HI all
    I've found an issue with the way that XFA 3.3 processes the script below on a change event when a user paste's more than 1 character to a textfield.
    var sChange = xfa.event.change;
    if((sChange.length>1)){
        app.alert("Bad User\nCopy and paste has been disabled for this field");
        //discard the change
        xfa.event.change = "";
    in XFA 3.0 the alert is sent and change is removed, in XFA 3.3 the alert is sent but the change persists.
    Any Ideas?

    Hi Mark,
    Unfortunately thats not possible as I'm using Flash Fields with data being passed between the PDF and the Flex app which only works in XFA3.3, let me know when its fixed.
    Kind Regards
    Kevin Mortimer
    Solutions Archtect
    Avoka

  • Acrobat Web Capture cannot convert javascript links...?

    In Matrix (Multiple Listing Service) Acrobat Adobe 10 Standard won't convert javascript links in newly created PDFs Documents from Matrix.   The Error message is : Acrobat Web Capture cannot convert javascript links and the link often does not work correctly when opened in the web browser...  
    Is there any javascript download or work around program that can fix this problem?
    Thanks

    Probably not. Pretty hard for Acrobat to handle all of the web JavaScript and possible function calls that could appear on a web page and be located in another directory.
    If this is important to you, you can use the bug report/feature request page at adobe.com..

  • Convert javascript array to java array

    Is there any way possible to convert javascript array to java array?

    if you will try to experiment a javascript array
    putting it to a hidden element, it will be converted
    to a string (comma delimited). You can get the value
    of that element as a string and use StringTokenizer
    class to put the values into a java arrayThanks, got it.

  • Mix formCalc and javascript in same event?

    Hi Folks,
    I have a bunch of formCalc and Javasript I'm trying to merge (two different forms, different programmers).   Is it possible to mix javascript with formCalc in the same field event?   If so, how?
    thanks!

    No, it is not possible to mix FormCalc and JavaScript in the same event. You will get run-time errors.
    Steve

  • Converting JavaScript "Variables"/Functions into Designer 7

    Hi,
    I'm upgrading our Forms which were created in Adobe 6 to Adobe 7 with Adobe Designer 7. One of the biggest problems that I'm encountering is the function library we developed in-house, which now shows under 'variables' at the Form level. The whole library was written in JavaScript.
    Listed below is a sample function:
    ----- F.#variables[0].DL_resetDefaultColor::DL_resetDefaultColor - (JavaScript, client) ------------
    # This function resets all the field elements to its default color ***************************************************************/ function DL_resetDefaultColor()
    //Get the array of all the form field elements names
    rArray = DL_getFormElements(); //Calling another function
    for (var i=0; i < rArray.length; i++) { DL_setDefaultColor(rArray[i]); } }
    Most of these functions are called from Button::mouseUp events, however when the button is clicked the Debugger gives the following error:
    TypeError: DL_resetDefaultColor is not a function
    6:XFA:F[0].P1[0].button_name[0]:mouseUp
    Please help in explaining how I may do this with Designer.
    Thank you,
    Ali

    Do you have this fixed yet?

Maybe you are looking for

  • JRE 1.4.2_02 on solaris: java.lang.error

    Hi, I've just installed JRE 1.4.2_02 on a server running Solaris 8. The installation procedure went by without problems/errors (as described on Sun's pages: http://java.sun.com/j2se/1.4.2/jre/install-solaris.html) When I try to execute java.exe (i.e:

  • Portal application parameters for webdynpro ABAP

    I have read several posts that indicate we can get the portal user login id in WDA by adding: userid=<User.LogonUid> to the application parameter property in the portal iview, and then adding a corresponding parameter in the Webdynpro ABAP method HAN

  • Test von volki

    Hi All, I am trying to upload Master GL accounts through lsmw. I have nearly 15 fields in my excel spread sheet and using a flat file after converting to .txt. Can any one suggest me which transaction code to be used?, I have tried with fs00, fs01 et

  • Invoice number on invoice overlapping with other texts

    Dear Friends, Invoice number on invoice overlapping with other texts On the top right corner of the second page of the invoice, Invoice number is overlapping with the text 'Invoice/Invoice Number'. The text 'Tax Invoice/Invoice Number' should be abov

  • Blend overpinting inconsistencies in PostScript

    I've noticed strange overprinting behavior of AI CS2 blends when PostScript output is envolved. I was looking for alternative ways of creating drop shadows without raster effects and tried overprinting gray blends for that. While in AI CS2, the idea