如何在提交后在引导程序对话框中验证?

时间:2016-09-04 02:28:03

标签: jquery twitter-bootstrap

我想验证用户推送提交后的一些字段是空的什么都不做,但我使用bootstrap对话框,我不知道如何使用,如果有其他...如果有人会帮助我更好。 。

$(function(){
    URL_GET_DATATABLE = BASE_URL+'inventory/provider/datatable';
    $('#example').DataTable({
        "lengthChange": false,
        ajax: {
            url: URL_GET_DATATABLE,
            type: 'POST'
        }
    });

    $('#add_item').on('click',function(){
        BootstrapDialog.show({
            message:  $("<form class='form-inline' id='providerForm'><div class='form-group'><label class='full_name'>Full name</label> <input type='text' class='_full_name form-control' name='full_name'></div><div class='form-group'><label class='phone' for='phone'>Phone</label> <input type='text' class='_phone form-control'></div><div class='form-group'><label class='email' for='email'>E-mail</label> <input type='text' class='_email form-control'></div><div class='form-group'><label class='rfc' for='email'>Rfc</label> <input type='text' class='_rfc form-control'></div><div class='form-group'><label class='address' for='address'>Address</label> <input type='text' class='_address form-control'></div>"),
            closable: true,
            closeByBackdrop: false,
            closeByKeyboard: false,
            buttons: [{
                id: 'submit',
                icon: 'glyphicon glyphicon-send',
                label: 'Send ajax request',
                cssClass: 'btn-primary',
                autospin: true,
                action: function (dialogRef) {
                    dialogRef.enableButtons(false);
                    dialogRef.setClosable(false);
                }
            }]
        });
    });
});

HTML

<section class="content">
        <section class="col-lg-12 connectedSortable">
            <div class="box">
                <div class="box-header">
                    <div class="box-title">Lista De Productos</div>
                </div>
                <div class="box-body">
                  <button class="btn btn-primary" id="add_item">New item</button>
                    <table id="example" class="table table-bordered table-striped">
                        <thead>
                            <tr>
                                <th>Nombre del proveedor</th>
                                <th>RFC</th>
                                <th>Teléfono</th>
                                <th>Correo electrónico</th>
                                <th>Domicilio</th>
                            </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </section>
    </section>

0 个答案:

没有答案