Я вижу проблему с Livewire, когда использую ЛЮБУЮ форму Javascript. Используйте следующую форму: https://bbbootstrap.com/snippets/multi-step-form-wizard-30467045 (Хотя я пробовал другие формы, и это происходит со мной из-за событий wire: model из livewire)
Проблема в том, что WIRE: MODEL переводит меня в первый раздел, и я не могу использовать WIRE: IGNORE, потому что он переопределяет поведение, связанное с SELECT.
Во втором разделе я использую следующую связанную форму:
<div class="form-group">
<label for="provincia">Provincia</label>
<select wire:model="ubicacionSeleccionada" class="form-control" id="ubicacion">
<option value=''>Seleccionar provincia</option>
@foreach($ubicaciones as $ubicacion)
<option value="{{$ubicacion->id}}">{{ $ubicacion->ubicacion }}</option>
@endforeach
</select>
</div>
<div class="form-group">
<label for="tipopropiedad">Localidad</label>
<select wire:model="area" class="form-control" id="localidad
{{ count($this->areas)== 0 ? 'hidden' : '' }} ">
<option value=''>Seleccionar localidad</option>
@foreach($this->areas as $area)
<option value={{ $area->id }}>{{ $area->name }}</option>
@endforeach
</select>
</div>
И это не позволяет мне использовать WIRE: IGNORE для прерывания событий.
Проблема в том, что любой WIRE: MODEL генерирует событие, которое принимает форму первого раздела. Вроде бы ОСВЕЖЕНИЕ
Кто-нибудь знает, как можно было бы использовать livewire без этого неудобства?
ИЗДАНИЕ
КНОПКА СЛЕДУЮЩИЙ ПРОСМОТР
<input type="button" name="next" class="next action-button" value="Continue" />
JAVASCRIPT
<script>
$(document).ready(function() {
var current_fs, next_fs, previous_fs; //fieldsets
var opacity;
$(".next ").click(function() {
current_fs = $(this).parent();
next_fs = $(this).parent().next();
//Add Class Active
$(".progressbar li ").eq($("fieldset ").index(next_fs)).addClass("active ");
//show the next fieldset
next_fs.show();
//hide the current fieldset with style
current_fs.animate({
opacity: 0
}, {
step: function(now) {
// for making fielset appear animation
opacity = 1 - now;
current_fs.css({
'display': 'none',
'position': 'relative'
});
next_fs.css({
'opacity': opacity
});
},
duration: 600
});
});
$(".previous ").click(function() {
current_fs = $(this).parent();
previous_fs = $(this).parent().prev();
//Remove class active
$(".progressbar li ").eq($("fieldset ").index(current_fs)).removeClass("active ");
//show the previous fieldset
previous_fs.show();
//hide the current fieldset with style
current_fs.animate({
opacity: 0
}, {
step: function(now) {
// for making fielset appear animation
opacity = 1 - now;
current_fs.css({
'display': 'none',
'position': 'relative'
});
previous_fs.css({
'opacity': opacity
});
},
duration: 600
});
});
$('.radio-group .radio').click(function() {
$(this).parent().find('.radio').removeClass('selected');
$(this).addClass('selected');
});
$(".submit ").click(function() {
return false;
})
});