简体   繁体   中英

Trying submit a form with parsley js and blade

I'm using parsley js with blade to validate the form but I can not submit. Inputs are being validated normally but nothing happens. My code looks like this:

{{ Form::open(['method' => 'PUT', 'id' => 'form-cronoanalise-edit', 'data-parsley-validate']) }}

                    <input type="hidden" name="pro-id" id="hidden-id">

                    <div id="show-maquina">
                        <div class="form-group">
                            <label>Referência da Máquina</label>
                            <select class="form-control" name="ref-maquina" id="ref-maquina"></select>
                        </div>
                        <div class="form-group">
                            <label>Tempo</label>
                            <input class="form-control" type="text" name="tempo-maquina" id="tempo-maquina" data-parsley-required="true">
                        </div>
                    </div>

                    <div id="show-funcionario">
                        <div class="form-group">
                            <label>Setor</label>
                            <select class="form-control" name="setor" id="setor-edit"></select>
                        </div>
                        <div class="form-group">
                            <label>Funcionário</label>
                            <select class="form-control" name="funcionario" id="funcionario-edit"></select>
                        </div>
                        <div class="form-group">
                            <label>Tempo</label>
                            <input class="form-control" type="text" name="tempo-funcionario" id="tempo-funcionario" data-parsley-required="true" data-parsley-type="number">
                        </div>
                    </div>

                    <div class="btn-group">
                        {{ Form::submit('Alterar', ['class' => 'btn btn-warning', 'id' => 'btn-submeter']) }}
                        <a href="javascript;;" class="btn btn-default" data-dismiss="modal">Cancelar</a>
                    </div>

                    {{ Form::close() }}

This form is displayed within a modal bootstrap. Can anyone help?

As usual, without a working example, it's very hard to tell exactly what's going on.

I'd try removing the data-parsley-validate and binding it yourself with Javascript once the modal is open.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM