I have a little doubt that I would like to solve and the truth on the internet does not leave anything clear. I have a form (in this case where I fail to recover the password), which has all its divs and other necessary elements to validate the password and reset it:
<form class="form-horizontal form-simple" method="POST" action="{{ route('password.request') }}">
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">E-Mail Address</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" required autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password" required>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div>
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation" required>
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
</div>
</div>
Well, with this form everything works correctly, but when I try to implement my template, it tells me that the password confirmation is not correct, and everything to change the divs, by fieldset to organize the view a little better. My custom form is as follows:
<form class="form-horizontal form-simple" method="POST" action="{{ route('password.request') }}">
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<fieldset class="form-group position-relative has-icon-left {{ $errors->has('email') ? ' has-error' : '' }}">
<input type="email" class="form-control form-control-lg input-lg" name ="email" id="email" placeholder="Introduzca su email" value="{{old('email')}}">
<div class="form-control-position"><i class="icon-head"></i></div>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
</fieldset>
<fieldset class="form-group position-relative has-icon-left {{ $errors->has('password') ? ' has-error' : '' }}">
<input id="password" type="password" name="password" placeholder="Contraseña nueva" class="form-control form-control-lg input-lg " required confirmed>
<div class="form-control-position"><i class="icon-key3"></i></div>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</fieldset>
<fieldset class="form-group position-relative has-icon-left {{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<input type="password" class="form-control form-control-lg input-lg" name="password-confirm" id="password-confirm" placeholder="Repita contraseña" required confirmed>
<div class="form-control-position"><i class="icon-key3"></i></div>
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</fieldset>
<button type="submit" class="btn btn-primary btn-lg btn-block"><i class="icon-unlock2"></i>Restablecer contraseña </button>
@include('errors.flash-message')
</form>
I've read that you have to add a field to the fieldset for validation, but it has not worked, it really gives me a little bit if I can get it to work because it's just curiosity, but I have to admit it's a little frustrating
Greetings and thanks for your time.