I'm trying to pass three parameters to the controller using Laravel's post method on dropdown select list. I can't figure it out how to pass the third one. It depends on the other two parameters under the following MySQL:
SELECT id
FROM maintable
WHERE profileId='ValueOfTheFirstSelection'
AND departmentId='ValueOfTheSecondSelection';
My form:
<form action="/admin/postmaps" name="form" method="post">
<div class="input-group">
<span class="input-group-addon">Profile ID</span>
<select class="form-control" name="select1" id="select1">
<?php use App\Department; $ids = DB::table('departments')->select('profileId')->get();$a = array();?>
@foreach ($ids as $id )
<?php $a[] = $id->profileId; ?>
@endforeach
<?php $a = array_unique($a); ?>
<option disabled selected value> </option>
@foreach ($a as $element )
<option value="<?php echo $element; ?>">{{ $element }}</option>
@endforeach
</select>
</div>
<div class="input-group">
<span class="input-group-addon">Department ID</span>
<select class="form-control" name="select2" id="select2">
<?php $ids = DB::table('departments')->select( 'id')->get();$b = array();?>
@foreach ($ids as $id )
<?php $b[] = $id->id; ?>
@endforeach
<option disabled selected value> </option>
<?php for ($i = 0; $i < count($b); ++$i) {
echo "<option value='$b[$i]'>".$b[$i]."</option>";
}
?>
</select>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button>
<button type="submit" class="btn btn-primary" id="updateTerminalInfo">Save</button>
<input type="hidden" value="{{ Session::token() }}" name="_token">
</div>
</form>