Is there a way to send the div data in the form?

Asked 2 years ago, Updated 2 years ago, 48 views

Is there a way to send div data in form method=post?
Below is the Ravel code.

I would like to send divid="tetsuya", is there a good way?
Do I have no choice but to use hidden and insert it?

<form method="post" action={{route('output')}}>
    @csrf   
    <input type="text" id="komuro" name="kei" value=""> 
    <divid="tetsuya">63</div>
</form>

html laravel

2022-09-30 19:33

1 Answers

The formdata event is simple.

form.addEventListener('formdata'e=>{
  e.formData.append('mitsuko', document.querySelector('#tetsuya').textContent);
});


2022-09-30 19:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.