for some reason i cannot post my html code here
Aug 29, 2020
4
Level 1
Laravel 7 - Form with a custom CSS doesn't select file
If I use the following code for my form that is based on Admin Lite theme - it neither selects the file nor uploads it. I can browse through files on my macbook but cannot select one.
'
<div class="form-group">
<div class="input-group" >
<div class="custom-file">
```<form method="POST" action="{{ route('logoupload') }}" enctype="multipart/form-data">```
```@csrf```
```<input type="file" class="custom-file-input" id="logo" name="logo">```
```<input type="hidden" id="companyid" value="{{ $company->id }}" name="companyid">```
```<label class="custom-file-label" for="logo">Add / Update Logo</label>```
```</div>```
```<br>```
```<div class="input-group-append">```
```<span class="input-group-text">Upload</span>```
```</div>```
```</form>```
</div>
<!-- However, if I use the following code everything works fine: -->
<form method="POST" action="{{ route('logoupload') }}" enctype="multipart/form-data">
@csrf
<label for="logo">Select file</label>
<input type="file" id="logo" name="logo">
<input type="hidden" id="companyid" value="{{ $company->id }}" name="companyid">
<button type="submit" name="Submit">Submit</button>
</form>
What am I doing wrong?
Please or to participate in this conversation.