Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

190
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!