17 lines
590 B
PHP
17 lines
590 B
PHP
<x-leenooks::form.base {{ $attributes }}>
|
|
<input type="file" class="form-control {{ $classes ?? ''}}@error($old ?? $name) is-invalid @enderror" id="{{ $id ?? $name }}" name="{{ $name }}" @readonly(isset($readonly)) @required(isset($required))>
|
|
</x-leenooks::form.base>
|
|
{{ $slot }}
|
|
|
|
@section('page-scripts')
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#{{ $id ?? $name }}').on('change',function(){
|
|
//get the file name
|
|
var fileName = $(this).val();
|
|
//replace the "Choose a file" label
|
|
$(this).parent().next('.input-helper').html(fileName);
|
|
})
|
|
});
|
|
</script>
|
|
@append |