I have the following code, it turns out that I want to capture all the Values
of a Select
hidden once the page is loaded in Html , capture them in Javascript and send them by means of a JSON
to the controller of 'laravel.
Here is the code, thank you very much for your help:
<div>
<select name="annios[]" id="annios" hidden multiple="multiple">
@foreach($precebo as $fecha)
<option value="{{$fecha->año_destete}}">{{$fecha->año_destete}}</option>
@endforeach
</select>
</div>
This is what the array generates:
var array =$("[name='annios[]']").val();
I think it may be a mistake when I generate it.