Last active
December 1, 2016 14:40
-
-
Save talha08/da63d6fcafa1fa33f407a6668f85a4ba to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
................................... | |
View | |
................................... | |
{!! Form::open(array('route' => 'jobSeeker.educationStore', 'novalidate' => 'novalidate' , 'method' => 'post', 'class' => 'cmxform form-horizontal tasi-form')) !!} | |
<div class="form-control"> | |
{!! Form::label('institution', "School/University Name*", array('class' => '')) !!} | |
{!! Form::text('institution[]', null, array('class' => 'form-control', 'placeholder' => '', 'required' => 'required', 'aria-required' =>'true')) !!} | |
<br> | |
</div> | |
<div align="right"> | |
<a style="color: white" class="btn btn-warning click"><i class="fa fa-plus-circle" aria-hidden="true"></i></a> | |
<br><br> | |
</div> | |
<div class="col-xs-12"> | |
{!! Form::submit('Submit', array('class' => 'btn btn-lg btn-login btn-block btn-success ', 'type'=>'submit')) !!} | |
</div> | |
{!! Form::close() !!} | |
................................................... | |
Javascript|minifiy this institute variable | |
................................................... | |
<script type="text/javascript"> | |
var institute = | |
'<div class="form-control"> | |
{!! Form::label('institution', "School/University Name*", array('class' => '')) !!} | |
{!! Form::text('institution[]', null, array('class' => 'form-control', 'placeholder' => '', 'required' => 'required', 'aria-required' =>'true')) !!} | |
<br> | |
</div><br>' | |
$('.click').click(function(){ | |
$('.append').append(institute); | |
}); | |
</script> | |
................................... | |
Controller | |
................................... | |
public function stepEducationStore(Request $request) | |
{ | |
$count_institution = count($request->institution); | |
if($count_institution != 0){ | |
for ($i = 0; $i < $count_institution; $i++) { | |
$education = new EmployeeEducation(); | |
$education->institution = $request->institution[$i]; | |
$education->save(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment