0

I have html object as -

<html>
    <object type="text/html" data="https://somesite.com" style="
    height: 250%;" width="100%" height="100%">
      --- somesite's own form--
    <form name="aspnetForm" method="post" action="actionurl" id="aspnetForm" style="margin-bottom:0;margin-top:0;">
    </object>
</html>

form tag seen in object is somesite.com 's internal form. I want to write javascript on my page using this object that , when action of this form is changed , I should handle that event.

What is event for form action change in javascript ?

C Sharper
  • 8,284
  • 26
  • 88
  • 151
  • Normally the action of a form isn't changed after the page is loaded. is that really what's happening here? But anyway, if you really need it - https://stackoverflow.com/questions/41424989/javascript-listen-for-attribute-change looks like probably what you are looking for – ADyson Sep 18 '20 at 10:20
  • @ADyson case is - Somesite.com I have embedded within object of my website. And after performing certain operation , it is redirecting to our return url , but we are not able to capture it's redirection , since it changes only form action and it has no control over object (html used) on our site. We want to redirect it as a parent on our browser. – C Sharper Sep 18 '20 at 10:23
  • You could add an `iframe` and set the `target` of the `form` to that `iframe`. By adding `onload()` to that `iframe` you can react to the response of the forms submit, after it happened. – Lain Sep 18 '20 at 10:28

0 Answers0