I have a dynamic form which loops through an input field and pulls in a dynamic name for each input. How can I use $request->input('')
on an unknown name tag. I also want to validate these fields but not my name field, so I need to tell the differance between the looped field & the input.
Example fieldset -
<form id="" method="post" action="">
<input id="name" type="text" name="full-name" />
@forelse($options as $option)
<select class="ticket-qty" name="">
<option value="0">0 Option</option>
<option value="1">1 Option</option>
<option value="2">2 Option</option>
<option value="3">3 Option</option>
<option value="4">4 Option</option>
<option value="5">5 Option</option>
</select>
@empty
<p>Sorry, no inputs fields</p>
@endforelse
</form>
I understand you can use, $request->all();
but I have no way to tell if the name is an option or any other input field.
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire