1 Reply Latest reply on Apr 16, 2019 5:43 PM by Michael Ferrante-Oracle

    forms javascript communication

    Walid KHARRAT

      Hi,

      i want to achieve forms js communication (html menu). So when user click i pass the name of the link form. This code work fine in ie :

      var x = document.getElementById("testjs");
      var y = x.contentWindow.document;
      y.forms_frame.raiseEvent('call_form',form.nom.toLowerCase());}
      

      this work fine with IE11 but i want to use it with firefox esr 52.9 and google chrome 43. Both support applet

      i add this function(found in the net)  to my js like this:

       function raiseEvent(element, eventName, eventDetails) {
              var event;
              var bubbles = true;
              var cancelable = false;
              try {
                  event = new CustomEvent(eventName, {
                      bubbles: bubbles,
                      cancelable: cancelable,
                      detail: eventDetails
                  });
              } catch (e) {
                  event = document.createEvent("CustomEvent");
                  event.initCustomEvent(eventName, bubbles, cancelable, eventDetails);
              }
              element.dispatchEvent(event);
          }
      

      so my code becomes:

      raiseEvent(y.forms_frame,'call_form',form.nom.toLowerCase());
      

       

      in firefox or ie theres no error in javascript console but nothing happen.

      how can i dispatch the event like with the IE raiseEvent.

       

      regards

       

      Walid