I am uploading an image using laravel form.It works by clicking a button that triggers the browse to upload event without actually displaying thr browse to upload button.In the normal case the name is displayed when I select an image. However since I have hidden the form nothing appears. I just need to display only the name of the image selected without the button. Here's my code:
blade.php
<div class="medium-4 columns form-section">
<h5>Photo</h5>
<div class="circle">+</div>
{{Form::file('photo', ['style'=>'display:none'])}}
@if($errors->has('photo'))
lass="error">{{$errors->first('photo')}}</p>
@endif
</div>
.js file
$(".circle").click(function() {
console.log($(this).parent().find("input[name='photo']"));
$(this).parent().find("input[name='photo']").trigger("click");
});
Also, is there such a way i can preview the image to the user before confirming the upload?