send_employer.blade.php 3.22 KB
<script>
    $(document).on('change', '#file', function() {
        let dirArray = $(this).val().split('\\')
        $('#this_final_name').html(dirArray[dirArray.length - 1])
    });
</script>
<div id="send2" class="modal">
    <div class="modal__body">
        <div class="modal__title">Отправить сообщение</div>
        <form class="modal__form" id="form_from_emp" name="form_from_emp" enctype="multipart/form-data" action="{{ route('employer.new_message') }}" method="POST">
            @csrf
            <div class="modal__form-item" style="display:none">
                <!-- Отправитель сообщения: -->
                <input type="hidden" id="_user_id" name="_user_id" class="input" placeholder="user_id" value="">
                <!-- Получатель сообщения: -->
                <input type="hidden" id="_to_user_id" name="_to_user_id" class="input" placeholder="to_user_id" value="">
                <!-- Вакансия: -->
                <input type="hidden" id="_vacancy" name="_vacancy" class="input" placeholder="vacancy" value="">
            </div>
            <div class="modal__form-item">
                <input id="i1" type="text" name="title" class="input" placeholder="Тема" required>
                <label for="i1">Не заполнено поле</label>
            </div>
            <div class="modal__form-item">
                <textarea id="i2" class="textarea" name="text" placeholder="Напишите текст с предложением о работе" required></textarea>
                <label for="i2">Не заполнено поле</label>
            </div>
            <div class="modal__form-item">
                <div class="file">
                    <label class="file__input">
                        <input type="file" name="file" id="file"  accept=".pdf, .xls, .xlsx">
                        <span class="button button_light">
                            <svg>
                                <use xlink:href="{{ asset('images/sprite.svg#share') }}"></use>
                            </svg>
                            Прикрепить документ
                        </span>
                    </label>

                    <div class="file__list">
                        <div class="file__list-item">
                            <div class="file__list-item-left">
                                <svg>
                                    <use xlink:href="{{ asset('images/sprite.svg#clip') }}"></use>
                                </svg>
                                <span id="this_final_name" name="this_final_name"></span>
                            </div>
                            <button type="button" class="file__list-item-right js-parent-remove">
                                <svg>
                                    <use xlink:href="{{ asset('images/sprite.svg#cross-bold') }}"></use>
                                </svg>
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="modal__form-item">
                <button type="submit" class="button">Отправить</button>
            </div>
        </form>
    </div>
</div>