Javascript works in Designer preview mode, but not when invoked via process

I have a fragment consisting of a subform and a text object. The subform has the following Javascript for its initialize event:
var cars = $data.input.cars.car.all;
var showMe = false;
for (var i = 0; i < cars.length; i++) {
if(cars.item(i).color && cars.item(i).color.value == 'RED')
showMe = true;
break;
if(!showMe) {
this.presence = 'hidden';
The code is supposed to loop through all my input XML data's cars, see if each car has a color element, and if so, see if the color is RED. If any of the cars have a color of RED, the fragment should be visible. Otherwise, it should be hidden.
The Javascript works fine when I preview the fragment in Designer using a sample XML input file with no color element (i.e. the text in the fragment is hidden).
The Javascript works fine in my main document (which has the fragment included in it) when in preview mode in Designer.
The Javascript does not work when I invoke my process in LiveCycle server. I pass in data that has 1 car without a color element, and for some reason my fragment is visible.
Is there something wrong with my Javascript? Is this the wrong way to check to see if an XML element is present? Is something else wrong?
Any help would be appreciated!
Thanks,
Andy

I guess a more appropriate question might be:<br /><br />How can I tell if my XML input data does or does not contain an element?  Let's say I have<br /><br /><input><br />  <cars><br />   <car><br />     <make>VW</make><br />   </car><br />  </cars><br /></input><br /><br />How can I use Javascript to safely determine if the car has a <color> element?

Similar Messages

  • Email button works in preview mode but not when published to PDF

    I thought I had cracked everything but -  I have set preferences to email results to a specific address. In preview mode this works and outlook is opened with all the details. Once I have published to Acrobat 9 pdf - there is no response to the email button. If I play the SWF file I have the same problem. What am I doing wrong? Using Captivate 5 trial and Acrobat 9.3 Pro.

    HI there
    You might try adding the location to the trusted locations list as described below:
    Click here to view
    But i'm guessing you didn't see the link below.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    Captivate Wish Form/Bug Reporting Form
    Adobe Certified Captivate Training
    SorcerStone Blog
    Captivate eBooks

  • Embedded swf plays in preview mode but not when loaded onto site

    http://delormdesigns.com/Oxen2008/2008Fair.html
    I have created a swf by first creating an flv from an avi then publishing the swf in flash. I inserted into an html page and can see the video on preview. However, when I load the page and all of the assets onto the site, I get nothing.
    I tried to view the swf directly, and it does not play. This may be an issue with how I converted the avi file or how I published the swf. I am starting in this forum just in case.
    Thanks!

    Yes, I did exactly what you recommended. I swapped the swf with another, loaded the page, and tested it. It worked perfectly. So, even though the original swf worked fine during the preview test, there must be something about the file that does not work when loaded on the site.
    I found an article about creating and inserting a flv file from an avi...that will get me 1/2 way there so I will be trying that. Perhaps there was a step in the avi to flv process that needs fixing...and then the swf creation would work.
    I appreciate your responses!
    ~ Caprice

  • I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    I am creating webpages with frontpage and trying to make collapsible lists. The lists collapse and work correctly in "preview" mode, but do not work when accessed through firefox or explorer 8. Does anyone know what I am doing wrong?

    Welcome to the 'wonderful' world of HTML5 e-learning.
    In my view, from the issues I am seeing everywhere, HTML5 output from rapid e-learning tools such as Captivate is not ready for the kind of mobile device e-learning you want to develop.
    Sorry to be pessimistic, but you may need to consider going back to the drawing board and coding it from the ground up.

  • Works in Main Application mode but not the orange NXT mode for some NXT's

    A simple Labview program designed using only NXT VI's worked  in the Main Application but not in NXT mode.  For some NXT's it  worked in both modes but for others, just in Main Application mode. I've tried  updating the firmware and plugging and unplugging the USB.  Any thoughts?

    I see. The problem is probably that when you are switching to the NXT Target mode, it is expecting to target the other brick to which you already deployed. If you right-click on the orange banner menu in the lower left corner, you should be able to select the other NXT, or use "Find NXT..." to scan/search for bricks.
    Also, I reccommend giving all your NXTs unique names so this is more obvious. (you can use the NXT Terminal tool to do that).
    If you still can't get the VI to run in target mode, restart labview.

  • PDF form submission problem - works in Acrobat and Reader, but not when embedded in browser

    Hello everyone,
    I am trying to submit a PDF form to an application server.
    To do this, I added a "Submit" button to the PDF, configured the server's address and submit format, and tested the button.
    I opened the PDF in Acrobat Pro, clicked the button, and my web application received the form in PDF format just as I wanted.
    To make it work in Reader, I had to extend user rights via Acrobat Pro, and then the form worked inside Reader as well.
    Up to here, everything went fine.
    Then I embedded the PDF in a web page (which will be the final scenario) and it all stopped working.
    The submit button doesn't do anything anymore, and no data is sent to the application server.
    I even tried switching from the form's submit mechanism to calling event.target.submitForm(...) in Javascript directly, but nothing changed (meaning this too worked only when opening the form as an "offline" pdf, but not when embedding it in a web page).
    Is there something I am missing? Something else that must be configured/activated in order to be able to submit the PDF when it is in the form of an embedded object?
    Many thanks in advance,
    Alex

    Thanks for your reply, Paul.
    I tested the submit button both in Reader 9.3 and Acrobat 8 (which is the same I used to RE the PDF).
    Apparently I got it working too, but only by deploying my embedding web page to an application server.
    The final environment the PDF will be embedded into will be inside a web application deployed to an application server, so I guess my problem is solved.
    It didn't work only when embedded into a local test.html web page saved on my PC...
    Thanks again, have a good day.
    Alex

  • My iPhone 3G charges with a charger, but not when connected via USB to my computer and iTunes doesn't recognize it.

    Hello, my iPhone charges when I charge it with the wall plug but not when connected to a computer via USB and my iTunes doesn't recognize my iPhone either. iTunes recognizes my iPod and iPad just fine. I have been to Apple iPhone support page and I have restarted my iPhone, the computer, tried different USB ports, etc. I have also tried my iPhone on different macs even with different versions of iTunes and no luck. This all started when I was cleaning out some lint from the usb connector, could I have damaged some part of the docking connection? But why does it charge with a wall plug then?

    I fixed the problem. When I was trying to clean the connector of the iPhone I must have bent some pins. I have straightened them to the best of my ability and now it syncs. If your iPhone charges, but doesn't sync, most likely you have a similar problem, because the iPhone doesn't need all of its pins to charge, but it does need all of them to sync.

  • OSX Mountain Lion 10.8.4: imessage works fine in safe mode, but not in "normal" mode. Any hints?

    My iMessages does not work in "normal" startup, but it works perfectly in safe mode.
    Any hints?
    I have the same problem on a MacBook Pro 17" and on a MacAir 13" mid 2011.
    On my MacMini, iMessage work's fine.
    I'm using same apple ID on all 3 devices.
    Before update to 10.8.4, i had no problems.
    FaceTime also stopped working after update to 10.8.4.
    Thanks in Advance,
    Lars O.

    Please read this whole message before doing anything.
    This procedure is a diagnostic test. It won’t solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
    Third-party system modifications are a common cause of usability problems. By a “system modification,” I mean software that affects the operation of other software — potentially for the worse. The following procedure will help identify which such modifications you've installed. Don’t be alarmed by the complexity of these instructions — they’re easy to carry out and won’t change anything on your Mac. 
    These steps are to be taken while booted in “normal” mode, not in safe mode. If you’re now running in safe mode, reboot as usual before continuing. 
    Below are instructions to enter some UNIX shell commands. The commands are harmless, but they must be entered exactly as given in order to work. If you have doubts about the safety of the procedure suggested here, search this site for other discussions in which it’s been followed without any report of ill effects. 
    Some of the commands will line-wrap or scroll in your browser, but each one is really just a single line, all of which must be selected. You can accomplish this easily by triple-clicking anywhere in the line. The whole line will highlight, and you can then copy it. The headings “Step 1” and so on are not part of the commands. 
    Note: If you have more than one user account, Step 2 must be taken as an administrator. Ordinarily that would be the user created automatically when you booted the system for the first time. The other steps should be taken as the user who has the problem, if different. Most personal Macs have only one user, and in that case this paragraph doesn’t apply. 
    Launch the Terminal application in any of the following ways: 
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.) 
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens. 
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid. 
    When you launch Terminal, a text window will open with a line already in it, ending either in a dollar sign (“$”) or a percent sign (“%”). If you get the percent sign, enter “sh” and press return. You should then get a new line ending in a dollar sign. 
    Step 1 
    Triple-click the line of text below on this page to select it:
    kextstat -kl | awk '!/com\.apple/{printf "%s %s\n", $6, $7}' | open -f -a TextEdit 
    Copy the selected text to the Clipboard by pressing the key combination command-C. Then click anywhere in the Terminal window and paste (command-V). A TextEdit window will open with the output of the command. If the command produced no output, the window will be empty. Post the contents of the TextEdit window (not the Terminal window), if any — the text, please, not a screenshot. You can then close the TextEdit window. The title of the window doesn't matter, and you don't need to post that. No typing is involved in this step.
    Step 2 
    Repeat with this line:
    { sudo launchctl list | sed 1d | awk '!/0x|com\.(apple|openssh|vix)|org\.(amav|apac|cups|isc|ntp|postf|x)/{print $3}'; sudo defaults read com.apple.loginwindow LoginHook; sudo crontab -l; } 2> /dev/null | open -f -a TextEdit 
    This time you'll be prompted for your login password, which you do have to type. Nothing will be displayed when you type it. Type it carefully and then press return. You may get a one-time warning to be careful. Heed that warning, but don't post it. If you see a message that your username "is not in the sudoers file," then you're not logged in as an administrator. 
    Note: If you don’t have a login password, you’ll need to set one before taking this step. If that’s not possible, skip to the next step. 
    Step 3
    { launchctl list | sed 1d | awk '!/0x|com\.apple|org\.(x|openbsd)/{print $3}'; crontab -l 2> /dev/null; } | open -f -a TextEdit 
    Step 4
    ls -A /e*/{la,mach}* {,/}L*/{Ad,Compon,Ex,Fram,In,Keyb,La,Mail/Bu,P*P,Priv,Qu,Scripti,Servi,Spo,Sta}* L*/Fonts .la* 2> /dev/null | open -f -a TextEdit  
    Important: If you formerly synchronized with a MobileMe account, your me.com email address may appear in the output of the above command. If so, anonymize it before posting. 
    Step 5
    osascript -e 'tell application "System Events" to get name of every login item' | open -f -a TextEdit 
    Remember, steps 1-5 are all copy-and-paste — no typing, except your password. Also remember to post the output. 
    You can then quit Terminal.

  • BDC with call transaction VD02 works fin in A mode but not in N mode

    Hi All,
        I have BDC program developed in 4.6c using call transaction VD02 works fine with mode A but not with mode N.
    Now we upgraded to ECC 6.0.Do I need to change anything?

    No, you don't have to change anything for ECC. BTW, I wonder why VD02 is not working in the background for you?

  • My Javascript works in Dreamweaver Live View, But Not On The Server

    I set up a javascript function to set the focus to the first field in a form as the page loads.  It works fine in Dreamweaver's Live View, but not on the local or remote servers.  Here's the code:
    In the heading I have the following function:
    <script type="text/javascript">
    function setFocus()
    document.getElementById("firstname").focus();
    </script>
    In the <head tag, I have:
    <body onload="setFocus()" ...
    and the first field in the form is:
                <input name="firstname" type="text" id="firstname" style="text-align: center; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 14px; font-family: Arial, Helvetica, sans-serif;" tabindex="1" value="<?php echo $fstname; ?>" size="15" maxlength="20">
    I guess I must be missing something, but don't know what.

    EUREKA! (and OOOPPPPSS!)  I found the problem (and I thought javascript was case sensitive - according to the tutorial, it's supposed to be).
    Here's apparently wha hoppen.  The first field in the form is the person's first name, but it's also a SPRY validation field.  I gave the actual field the name and id of "firstname", and the SPRY validation the name "FirstName", figuring that scripts would be case sensitive.  In fact, when I first inserted the SPRY object, I tried to name it "firstname" also, but it wouldn't let me, so I capitalized the first letters, and it accepted that; that made me feel that this is OK.  Here's the entire field's code:          <label>First Name:
               <span id="FirstName">               
                <input name="fstname" type="text" id="fstname" style="text-align: center; color: #009; text-transform: capitalize; font-variant: normal; font-weight: bold; line-height: normal; font-style: normal; font-size: 14px; font-family: Arial, Helvetica, sans-serif;" tabindex="1" value="<?php echo $fstname; ?>" size="15" maxlength="20">
                <span class="textfieldRequiredMsg">A value is required.</span><span class="textfieldMinCharsMsg">Minimum number of characters not met.</span></span></label>
    I accidentally tripped over the answer when I started using the Dreamweaver's Edit>Find Next search to see if I had something else named "firstname", and I found that it located every permutation of that word (e.g. firstname, FirstName, FIRSTNAME etc.).  Having seen that, I tried changing the "name=" and "id=" to "fstname, and the same corresponding change in the javascript, and VOILA! it worked.  That leaves me rather curious about this alleged "case sensitivity" thing.  I get the impression that it IS case sensitive, except when IT'S NOT.  How does this work, and how do I know when it is and isn't?

  • C# SCOM SDK agent install works fine from debug mode but disconnects when built from installer

    My team is writing a C# application that installs SCOM agents on the fly. I used the code in :
    http://msdn.microsoft.com/en-us/library/hh329037.aspx
    as a template. Which works fine and will consistently install agents when I run it in debug from Visual Studio. But when I build an installer (using InstallShield), calls to:
    "AgentTaskResult results = adminServer.InstallAgents(agents, configuration);"
    always result in a Microsoft.EnterpriseManagement.Common.ServerDisconnectedException. The agent install even shows up in pending management on the SCOM server (but this sits in pending management forever and is never processed). Calling managementGroup.Reconnect();
    and retrying the agent install still results in a ServerDisconnectedException. The application has no problem doing other things with the managementGroup object (from debug or running from an installer). It can create MonitorConfigurationOverrides and
    gets events out of an outbound connector. So it seems like the disconnect problem is localized just to agent install requests.
    I looked in the Windows Event Log and found an OpsMgr SDK Service Error: 
    An exception was thrown while processing InstallAgents for session ID uuid:71d39b19-f9a7-4d4a-82ee-5043480af635;id=41.
     Exception message: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 778.
     Full Exception: System.Xml.XmlException: '.', hexadecimal value 0x00, is an invalid character. Line 1, position 778.
       at System.Xml.XmlTextReaderImpl.Throw(Exception e)
       at System.Xml.XmlTextReaderImpl.ParseNumericCharRefInline(Int32 startPos, Boolean expand, StringBuilder internalSubsetBuilder, Int32& charCount, EntityType& entityType)
       at System.Xml.XmlTextReaderImpl.ParseCharRefInline(Int32 startPos, Int32& charCount, EntityType& entityType)
       at System.Xml.XmlTextReaderImpl.ParseText(Int32& startPos, Int32& endPos, Int32& outOrChars)
       at System.Xml.XmlTextReaderImpl.ParseText()
       at System.Xml.XmlTextReaderImpl.ParseElementContent()
       at System.Xml.XmlReader.ReadString()
       at System.Xml.XmlReader.ReadElementString(String name)
       at Microsoft.EnterpriseManagement.RuntimeService.TaskRuntimeService.CreateRemoteJobXml(JobDefinition jobDefinition, ManagementPackTask task, Guid hsId)
       at Microsoft.EnterpriseManagement.RuntimeService.TaskRuntimeService.SubmitJobs(IList`1 jobDefinitions, Guid batchId, JobCategory category)
       at Microsoft.EnterpriseManagement.RuntimeService.TaskRuntimeService.SubmitTasksInternal(IList`1 jobDefinitions, Guid batchId, JobCategory category, PrepareResultSet prepareTaskResultCallback)
       at Microsoft.EnterpriseManagement.ServiceDataLayer.AdministrationService.InstallAgents(Guid batchId, IList`1 jobDefinitions)

    Hello,
    You might ask in the
    Visual C# Language forum on MSDN.
    Otherwise, perhaps the Operations Manager - Extensibility forum:
    http://social.technet.microsoft.com/Forums/systemcenter/en-US/home?forum=operationsmanagerextensibility
    Karl
    When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
    My Blog: Unlock PowerShell
    My Book: Windows PowerShell 2.0 Bible
    My E-mail: -join ('6F6C646B61726C40686F746D61696C2E636F6D'-split'(?&lt;=\G.{2})'|%{if($_){[char][int]&quot;0x$_&quot;}})

  • Javascript works on Safari for Windows but not on Safari for Mac (2.0.4)

    One part of our mail's web-based interface is not working properly when I use Safari on Mac (2.0.4). However, it works on Safari for Windows and Firefox. I browsed through a lot of the forum entrees with java/javascript on the subject and it seems that java processing is a common problem. I have checked all the necessary settings suggested on the forums but it still does not work.
    We tried using the new Safari on another machine and it works. However, I also see lots of forum entrees asking how to uninstall Safari 3!
    I also have a window on the open-source SugarCRM not working properly on Safari 2.0.4. Any fix coming?

    I noticed that as well. I have to wonder if it's due to not making note of the the different end of line characters between Mac OS X and Windows in code.

  • Oracle connection works in VB debug mode but not in EXE

    I have a small VB 6 app that writes to an oracle database on a unix server. Oracle 10g is installed on my pc. System DSN is set up in ODBC and corresponds to an entry in the tnsnames.ora file (to the best of my limited oracle knowledge..)
    The connection to the database works fine in debug bug. Test Connection of that DSN works as well. But when I build and execute the EXE file it returns : "TNS:could not resolve the connect identifier specified"
    What is different about the process of running an EXE that could cause this failure?

    I am having the exact same problem. What could be the difference in the way the debugger in VB handles DAO calls to an Oracle database in debug mode?!?!?

  • App working fine in debug mode but not otherwise on iPad

    Hi everyone,
    Sorry if I am putting this question in wrong section, this seems to be the most relative location to ask question.
    My Problem:
    I have developed an app using Adobe Air and starling. App is working perfectly when I run on Flash Builder (debug and run both). When deploying on iPad at one particular location, it is either not getting TouchPhase.ENDED or some code is crashing.
    I tried to debug while running app on iPad and its working absolutely fine. But when I create the ipa file normally i.e. without debug mode, at a particular location code is not working.
    Please help me out in this regard, asap. I need to deliver it.
    Please!!!!
    Thanks
    Waqar Iqbal

    Hi,
    I know one case, but don't know if have a solution.
    See Registering Add-on in 2004
    Best Regards.

  • Jco Connection works on Single server mode, but not over network?

    Hello,
    Error - com.sap.dictionary.runtime.DdException: 'XXXXXX' not properly defined! Unable to create Metadata connection for Dictionary Provider. Either the logical System Name 'XXXXXX' has not been properly defined in the System Landscape Directory, or you are not using a MsgServerDestination (AppServerDestinations are not permitted for Metadata connections
    This is the error at one of the remote machines. The JCo Connection works on the J2EE host system (while testing and pinging under the Single Server mode.)
    I believe this error will be rectified if I upgrade to SPS7, but we have certain other considerations that restrict us from doing that.
    Could someone please point out the exact location thats responsible for this if possible and maybe I could just upgrade that part and clear this?
    Thanks

    Hi,
    you should consider three  things if your java instance is on network.
    1. SLD ( check if java instance is listed on SLD and test the connection from portal to SLD.
    2. You need an entry in the services files of both the Java and ABAP servers as such:
    sapms<SID>  3600/tcp
    Remember to always have a blank line at the bottom of the services file!
    3. try to add the certificate in portal.
    if you can provide with the exact error message it would be easy to help.
    Kind regards,
    vamsi.

Maybe you are looking for

  • HELP Needed with this error:   Exception in thread "main" java.lang.NoClass

    Folks, I am having a problem connecting to my MSDE SQL 2000 DB on a WindowsXP pro. environment. I am learning Java and writing a small test prgm to connect the the database. The code compiles ok, but when I try to execute it i keep getting this error

  • Photoshop can't open TIF file?

    I've just received a TIF file (approx 5mb) that Photoshop can't open.  I get an error: " Could not complete your request because the file is not compatible with this version of Photoshop".  I've never had trouble with TIFs before, and assumed a TIF i

  • Help opening an image in Elements11

    When I tap on an image in my Window's photo folder, a selection of programs pop up, but PS Elements is not one of the.  When I press on browse, PS Elements 11 can not be found.  Signed: basket case.

  • Sysfsutils-2.1.0-5 [SOLVED]

    I am not sure when this happened. But today morning I ran yaourt -Syu. Tried to install the updates and I get this : (29/29) checking for file conflicts [#####################] 100% error: failed to commit transaction (conflicting files) sysfsutils:

  • Ipod device not showing up under overdrive player.

    Over the last couple of months I have successfully downloaded audiobooks to my nano from overdrive (windows desktop version), however over the last week my apple device is not showing as an option under overdrive 'player'.  The only option I am now r