I made an html form, put it on a platform that loads this form. But there are buttons on the platform that execute functions in the form (like send the form, save and etc). Here I found that I can manipulate these platform buttons with codes inside the form using this:
window.parent
For example, I can drop an alert when a certain button on the platform is pressed with this code:
window.parent.$(".fixedTopBar").find("button").on("click", function(ev) { alert("OK"); });
I have this button (which logically I can not change it since it is from the platform):
<button type="button" class="btn btn-primary" data-send="">Enviar</button>
And I want to run a script when it is pressed ... As I have other buttons on the page, I decided to capture the "on (click)" button with the data-send (since it is unique in that) p>
I've tried codes like:
window.parent.$('[data-send]').on("click", function(ev) { alert("OK"); );
window.parent.$('button[data-send]').on("click", function(ev) { alert("OK"); );
window.parent.$('button').data("send").on("click", function(ev) { alert("OK"); });
But it did not work. I do not understand much about the date attribute ... It should be from there the difficulty of understanding how to use it.
If it is better, I drew it as it is: [Red] Environment [Blue] form [Green Arrow] Button I want to capture the click