I am only getting the first id and not getting the rest of the id when i alert
Here is my input code
@foreach (entrepreneurs as entrepreneur)
<form name="ent-from" id="ent-form">
<input type="hidden" name="entrepreneur_id" id="entrepreneur_id" value="{{ $entrepreneur->id }}" readonly>
</form>
<button type="button" class="btn btn-custom" id="accept-btn">Accept</button>
@endforeach
Ajax
$('#accept-btn').on('click', function() {
var entrepreneur_id = $('#entrepreneur_id').val();
alert(entrepreneur_id);
});
Controller
public function handleAdmin()
{
$entrepreneurs = Entrepreneur::paginate(5);
return view('handleAdmin', compact('entrepreneurs'));
}