0

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?

worldask
  • 1,767
  • 3
  • 20
  • 36
omarsafwany
  • 3,215
  • 8
  • 41
  • 66
  • possible duplicate of [How to preview image before uploading in jquery](http://stackoverflow.com/questions/18694437/how-to-preview-image-before-uploading-in-jquery) – Mysteryos Sep 22 '14 at 06:28
  • @Mysteryos that previews the image which is my second part of the question. thank you Any idea how could i get the name?! – omarsafwany Sep 22 '14 at 06:33

0 Answers0