Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
Form in an iframe is not define : Edge issue

setting value to a form in iframe and submit the form.

window.frames['equityIFrame'].document.forms[0].[actionParam] = "equityAction";
window.frames['equityIFrame'].document.forms[0].submit();

This code works fine in IE and other browser.

In Edge browser, throws the below error.

cannot read the property 'forms' of undefined.

What will be the work around for this.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can use HTMLIFrameElement.contentWindow to access the iframe's document and its internal DOM. You can refer to my sample code below, it works well in Edge and other browsers:

iframe.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <iframe src="form.html" id="test"></iframe>
    <input type="button" value="click" onclick="ChangeIframe()" />
    <script>
        function ChangeIframe() {
            document.getElementById("test").contentWindow.document.getElementById("fname").value = "myname";
            document.getElementById("test").contentWindow.document.forms[0].submit();
        }
    </script>
</body>
</html>

form.html:

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title></title>
</head>
<body>
    <form action="index.html" method="get">
        <label for="fname">First name:</label>
        <input type="text" id="fname" name="fname"><br><br>
        <label for="lname">Last name:</label>
        <input type="text" id="lname" name="lname"><br><br>
        <input type="submit" value="Submit">
    </form>
</body>
</html>
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda