Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

183
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda