Workflow Soluiton

 View Only
  • 1.  Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 12, 2015 09:36 AM

    Hello,

    I have a problem with running Javascript custom behaviors on web browsers other than Internet Explorer.

    I've done everything like in video https://www-secure.symantec.com/connect/videos/adding-custom-javascript-workflow-web-forms-video and it's working on IE. Sadly if I open other web browser (like Chrome or Firefox) it won't working properly.

    Is it known issue? 



  • 2.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 12, 2015 12:17 PM

    You're not running a JS blocking plugin like NoScript/ScriptNo are you? You'll have to obviously enable JS on the page to get it working.

    Check the source of the web page to verify the JS is in fact being inserted. You can troubleshoot by just doing some basic window.alert(). I'm the maker of the vid you mentioned and I pretty much exclusively used Firefox as my browser of choice in all my vids.
     



  • 3.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 12, 2015 12:20 PM

    Hi Firan - send me a message if you want to have a quick look at your setup on Webex and we'll see what's going wrong.



  • 4.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 13, 2015 02:44 AM

    @reecardo I'm not running any JS blocking plugins. Actually I'm running fresh installation of Firefox and Chrome.

    window.alert() is in my code because I'm trying to make a popup. Just like I said it's working fine on IE.

    I checked the source of the page (in Google Chrome Console) and I didn't saw my JS.

    It's simple code:

    var e = document.getElementById("dropdownpart");

    var s= e.options[e.selectedIndex].value;

    if (s == "Sim") { window.alert("Bla bla bla."); }



  • 5.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 16, 2015 07:13 PM

    Try a window.alert after the var s declaration.

    I bet the value is undefined.

    I use Firebug to see what elements are involved, you may find that "dropdownpart" is not the ID to fetch.

     



  • 6.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 17, 2015 03:59 AM

    @bcason simple: window.alert("Bla bla bla."); without ANY other declarations doesn't work on Chrome or Firefox for me. It is working on IE.

    whatworks.jpg

    Event Show Message By Controls Value is working fine in IE, Chrome, Firefox. It shows popups but I can't use it for my purposes.

    Custom JS event is working only in IE so code should be fine.



  • 7.  RE: Custom JavaScript not working on Google Chrome/Mozilla Firefox

    Posted Mar 17, 2015 01:14 PM

    I've noticed that the onpropertychange event sometimes is flaky between browsers.

    Because oninput and onchange is unavailable in the Custom Events control, try adding the event in the Body Custom Events of the form page itself on the Behavior tab.

    add an onload event and adjust the attributes of your dropdown box like this:

    var ddNewLoc = document.getElementById('DropDownNewLocation');
    ddNewLoc.setAttribute('oninput','updateDrop();showSave();');

    oninput has worked pretty well for me in this regard.  you could also try onchange if that doesn't do it for you.

    in my example script above, any referenced functions added to "oninput" should go in the "Script" field of the Behavior tab for the form builder.  you should also be able to just write out the script between those apostrophes.  let me know if you need a hand.

    here's some additional reading on (and examples of) this method:

    http://atmaworkflow.com/2014/10/24/skirting-the-form-builder-components-javascript-onchange-event-reservations/

    http://atmaworkflow.com/2014/11/17/workflow-short-oninput-function/

    http://atmaworkflow.com/2014/12/15/highlight-element-by-checkbox-state/