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
How can let form submit the value of input inside shadow root of custom HTML element?

I created a custom HTML input element like follow:

<html>
<script>
    class TestInput extends HTMLElement {
      constructor() {
        super();
        var shadow = this.attachShadow({mode:'open'});
        var cinput = document.createElement('input');
        cinput.setAttribute('type', 'text');
        cinput.setAttribute('name', 'test');
        cinput.setAttribute('value', 'test');
        shadow.append(cinput);
        this.cinput = cinput;

        }
    }
customElements.define('test-input', TestInput);
</script>
<body>
<form action="/test">
  <test-input></test-input>
  <input type="submit"></input>
</form>
</body>
</html>

However, when I used spring to receive the form parameters, I get nothing. How can I submit the form with the value of input inside the shadow root?

about 4 years ago · Santiago Trujillo
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