Twitter bootstrap 使用Laravel 4+验证后,保持模态并显示错误;3引导
阅读文章: 启用在验证后立即打开模式框,但是,显示没有发生错误,只显示表单,我相信这是因为操作再次调用jquery表单,因为我使用的是远程函数bootstrap 3 model 提示解决并请在模式窗口中显示错误 控制器:Twitter bootstrap 使用Laravel 4+验证后,保持模态并显示错误;3引导,twitter-bootstrap,laravel,modal-dialog,validation,Twitter Bootstrap,Laravel,Modal Dialog,Validation,阅读文章: 启用在验证后立即打开模式框,但是,显示没有发生错误,只显示表单,我相信这是因为操作再次调用jquery表单,因为我使用的是远程函数bootstrap 3 model 提示解决并请在模式窗口中显示错误 控制器: if ($validacao->fails()) : $input = Input::all(); $input['autoOpenModal'] = true; return Redirect::back()->withErrors($valid
if ($validacao->fails()) :
$input = Input::all();
$input['autoOpenModal'] = true;
return Redirect::back()->withErrors($validacao)->withInput($input);
endif;
模态形式:
<div>
{{ Form::label( 'inputEmail1', 'Email', array( 'class' => 'col-lg-2 control-label' ) ) }}
<div>
{{ Form::email( 'email', '', array( 'class' => 'form-control', 'placeholder' => 'Email' ) ) }}
{{ $errors->first('email', '<p class="help-block text-danger">:message</p>') }}
</div>
</div>
{{Form::label('inputEmail1','Email',数组('class'=>'col-lg-2控件标签'))}
{{Form::email('email','',数组('class'=>'Form control','placeholder'=>'email'))}
{{$errors->first('email','help block text danger'>:message')}
Jquery操作:
<script type="text/javascript">
if ({{ Input::old('autoOpenModal', 'false') }}) {
$('#remoteModal').modal({show: true, remote: '{{ URL::to('users/inserir') }}'});
}
</script>
if({Input::old('autoOpenModal','false')}){
$('#remoteModal').modal({show:true,remote:'{{{URL::to('users/inserir')}});
}
我认为这个遥控器像一个新调用一样加载引导模式,因此他的$errors->first()
没有显示任何内容
已经感谢您的帮助您不需要在此处进行任何远程获取。表单已存在于页面上的模式中 正如你的帖子所说:
if ({{ Input::old('autoOpenModal', 'false') }}) {
//JavaScript code that open up your modal.
$('#remoteModal').modal('show');
}