@Arsen123

Как закрыть форму после валидации?

Добрый день! Как правильно закрыть форму, у меня есть валидация, но изза того, что на кнопке висит onclick="$.fancybox.close(true); $.fancybox.open({src: '#thanks'})" она закрывается без вывода ошибок. Как можно исправить данный момент?
сама форма
<form wire:submit.prevent="orderDelivery" class="modal-delivery__item modal-delivery__item--active"
              id="delivery1" wire:ignore.self>
            <div class="modal-delivery__group">
                @if ($errors->any())
                    <div>
                        <ul>
                            @foreach ($errors->all() as $error)
                                <li class="error">{{ $error }}</li>
                            @endforeach
                        </ul>
                    </div>
                @endif
             
                    <input type="text" class="input input--address" wire:model.defer="city" name="city" placeholder="Город" disabled>
                    <input type="text" class="input input--street" wire:model.defer="street" name="street"
                           placeholder="Улица">
                    <input type="text" class="input input--address" wire:model.defer="house" name="dom" placeholder="Дом">
                    <input type="text" class="input input--address2" wire:model.defer="flat" name="kv" placeholder="Квартира">
                    <input type="text" class="input input--address3" wire:model.defer="entrance" name="podezd"
                           placeholder="Подъезд">
                    <input type="text" class="input input--address4" wire:model.defer="floor" name="etaz" placeholder="Этаж">
                    <textarea name="comment" wire:model.defer="comment" placeholder="Комментарий к заказу"
                              class="textarea"></textarea>
              
            </div>
            <button class="btn btn--order"  wire:model="type_delivery" onclick="$.fancybox.close(true); $.fancybox.open({src: '#thanks'})" value="1">
                Оформить заказ
            </button>
        </form>
  • Вопрос задан
  • 66 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы