Added jquery-form-validator

This commit is contained in:
snipe 2018-10-04 23:50:57 -07:00
parent 4cc1351bdd
commit a6449fa16e
5 changed files with 14 additions and 5 deletions

View file

@ -35,6 +35,7 @@
"font-awesome": "^4.7.0",
"icheck": "^1.0.2",
"imagemin": "^5.3.1",
"jquery-form-validator": "^2.3.79",
"jquery-slimscroll": "^1.3.8",
"jquery-ui": "^1.12.1",
"jquery-ui-dist": "^1.12.1",

Binary file not shown.

View file

@ -8,7 +8,7 @@
"/css/skins/skin-red-dark.min.css": "/css/skins/skin-red-dark.min.css?id=99f90bbd653d7db10795",
"/css/signature-pad.css": "/css/signature-pad.css?id=6a89d3cd901305e66ced",
"/css/signature-pad.min.css": "/css/signature-pad.min.css?id=6a89d3cd901305e66ced",
"/js/vendor.js": "/js/vendor.js?id=c8bc37fd1a8b2d7aea69",
"/js/vendor.js": "/js/vendor.js?id=39523e966a9bc7a70731",
"/js/html5shiv.min.js": "/js/html5shiv.min.js?id=ba846cb704dbfbc5f1b3",
"/js/respond.min.js": "/js/respond.min.js?id=afc1984a3d17110449dc",
"/js/dist/bootstrap-table.js": "/js/dist/bootstrap-table.js?id=7223478ba9bf2c6dfb4f",

View file

@ -21,12 +21,12 @@
<!-- we are editing an existing asset -->
@if ($item->id)
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<input class="form-control" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', $item->asset_tag) }}" />
<input class="form-control" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', $item->asset_tag) }}" data-validation="required">
</div>
@else
<!-- we are creating a new asset - let people use more than one asset tag -->
<div class="col-md-7 col-sm-12{{ (\App\Helpers\Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<input class="form-control" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', \App\Models\Asset::autoincrement_asset()) }}">
<input class="form-control" type="text" name="asset_tag" id="asset_tag" value="{{ Input::old('asset_tag', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required">
</div>
<div class="col-md-2 col-sm-12">
<button class="add_field_button btn btn-default btn-sm"><i class="fa fa-plus"></i></button>
@ -111,8 +111,15 @@
@stop
@section('moar_scripts')
<script nonce="{{ csrf_token() }}">
$.validate({
form : '#create-form'
});
var transformed_oldvals={};
function fetchCustomFields() {
@ -226,7 +233,7 @@
box_html += '<span class="fields_wrapper">';
box_html += '<div class="form-group"><label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }} ' + x + '</label>';
box_html += '<div class="col-md-7 col-sm-12 required">';
box_html += '<input type="text" class="form-control" name="asset_tags[' + x + ']" value="{{ ($snipeSettings->auto_increment_prefix!='' && $snipeSettings->auto_increment_assets=='1') ? $snipeSettings->auto_increment_prefix : '' }}'+ incremented_tag +'">';
box_html += '<input type="text" class="form-control" name="asset_tags[' + x + ']" value="{{ ($snipeSettings->auto_increment_prefix!='' && $snipeSettings->auto_increment_assets=='1') ? $snipeSettings->auto_increment_prefix : '' }}'+ incremented_tag +'" data-validation="required">';
box_html += '</div>';
box_html += '<div class="col-md-2 col-sm-12">';
box_html += '<a href="#" class="remove_field btn btn-default btn-sm"><i class="fa fa-minus"></i></a>';

View file

@ -75,7 +75,8 @@ mix
"./node_modules/icheck/icheck.js",
"./resources/assets/js/extensions/pGenerator.jquery.js",
"./node_modules/chart.js/dist/Chart.js",
"./resources/assets/js/signature_pad.js"
"./resources/assets/js/signature_pad.js",
"./node_modules/jquery-form-validator/form-validator/jquery.form-validator.js"
],
"public/js/vendor.js"
)