Html Widget stoped! being accessible

iframe

#1

I know the title of my question is not the best, but i´m really surprise with what´s happening. The thing is, i have a form inside a html widget, i have coded everything inside the widget, even pointing to css and js files and everything was working great…until today!. To access an element inside my form i was using a simple:

var btnCancelar = hypeDocument.getElementById('idBtnCancelar');

but know it´s not working at all, so i have tried this:

var iframe = hypeDocument.getElementById('idFormDesktop').children[0];
var iframeDocument = iframe.contentDocument || iframe.contentWindow.document;
var btnCancelar = iframeDocument.getElementById('idBtnCancelar');

but it´s not working too…idFormDesktop is the id i have gave the html widget, the ONLY thing i did was changing this id name, which was previously idFrom1200.

can anyone help?!.

Regards


(Jonathan Deutsch) #2

It might help if you can post a zip of your .hype document; it is easier to directly look at it to analyze what is happening.

You might also be hitting a cross-domain origin policy error; I would check the console and see if that is the issue. If so, you’d need to communicate between parent and child with postMessage().