Answer the question
In order to leave comments, you need to log in
How to pull data from multiple POST form?
Good day to all gentlemen :)
I am writing a RESTful API.
I'm trying to get the selected data by the user, so that later I can somehow work with them in the controller.
As a matter of fact, there is: Form
u77144jd.beget.tech - Visual
Code:
https://github.com/Rishats/taskbackend/blob/master...
How to catch the result from this form? By pressing a button?
The documentation does not address this type of form.
If you know places where there are tutors or can help me process this form, please help :)
Thank you all :)
Answer the question
In order to leave comments, you need to log in
<form action="/update" method="POST" accept-charset="UTF-8">
...
public function update()
{
foreach (request()->multipleselect1 as $value)
echo "{$value}<br>";
foreach (request()->multipleselect2 as $value)
echo "{$value}<br>";
foreach (request()->multipleselect3 as $value)
echo "{$value}<br>";
foreach (request()->multipleselect4 as $value)
echo "{$value}<br>";
}
In code, your form looks like this:
<div class="col-lg-10">
<select class="form-control" multiple="multiple" id="multipleselect1[]" name="multipleselect1[]">
<option value="1">Овечка 1</option>
<option value="2">Овечка 2</option>
</select>
</div>
alert($("#multipleselect1[] option:selected").val());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question