env and vendor added temporary
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
<script>
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
$("<?= $validator['selector']; ?>").each(function() {
|
||||
$(this).validate({
|
||||
errorElement: 'span',
|
||||
errorClass: 'help-block error-help-block',
|
||||
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.parent('.input-group').length ||
|
||||
element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
|
||||
error.insertAfter(element.parent());
|
||||
// else just place the validation message immediately after the input
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).closest('.form-group').removeClass('has-success').addClass('has-error'); // add the Bootstrap error class to the control group
|
||||
},
|
||||
|
||||
<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>
|
||||
|
||||
ignore: "<?= $validator['ignore']; ?>",
|
||||
<?php endif; ?>
|
||||
|
||||
/*
|
||||
// Uncomment this to mark as validated non required fields
|
||||
unhighlight: function(element) {
|
||||
$(element).closest('.form-group').removeClass('has-error').addClass('has-success');
|
||||
},
|
||||
*/
|
||||
success: function (element) {
|
||||
$(element).closest('.form-group').removeClass('has-error').addClass('has-success'); // remove the Boostrap error class from the control group
|
||||
},
|
||||
|
||||
focusInvalid: true,
|
||||
<?php if (Config::get('jsvalidation.focus_on_error')): ?>
|
||||
invalidHandler: function (form, validator) {
|
||||
|
||||
if (!validator.numberOfInvalids())
|
||||
return;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $(validator.errorList[0].element).offset().top
|
||||
}, <?= Config::get('jsvalidation.duration_animate') ?>);
|
||||
|
||||
},
|
||||
<?php endif; ?>
|
||||
|
||||
rules: <?= json_encode($validator['rules']); ?>
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,54 @@
|
||||
<script>
|
||||
jQuery(document).ready(function(){
|
||||
|
||||
$("<?= $validator['selector']; ?>").each(function() {
|
||||
$(this).validate({
|
||||
errorElement: 'span',
|
||||
errorClass: 'invalid-feedback',
|
||||
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.parent('.input-group').length ||
|
||||
element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
|
||||
error.insertAfter(element.parent());
|
||||
// else just place the validation message immediately after the input
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).closest('.form-control').removeClass('is-valid').addClass('is-invalid'); // add the Bootstrap error class to the control group
|
||||
},
|
||||
|
||||
<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>
|
||||
|
||||
ignore: "<?= $validator['ignore']; ?>",
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
unhighlight: function(element) {
|
||||
$(element).closest('.form-control').removeClass('is-invalid').addClass('is-valid');
|
||||
},
|
||||
|
||||
success: function (element) {
|
||||
$(element).closest('.form-control').removeClass('is-invalid').addClass('is-valid'); // remove the Boostrap error class from the control group
|
||||
},
|
||||
|
||||
focusInvalid: true,
|
||||
<?php if (Config::get('jsvalidation.focus_on_error')): ?>
|
||||
invalidHandler: function (form, validator) {
|
||||
|
||||
if (!validator.numberOfInvalids())
|
||||
return;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $(validator.errorList[0].element).offset().top
|
||||
}, <?= Config::get('jsvalidation.duration_animate') ?>);
|
||||
|
||||
},
|
||||
<?php endif; ?>
|
||||
|
||||
rules: <?= json_encode($validator['rules']); ?>
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$("<?= $validator['selector']; ?>").each(function () {
|
||||
$(this).validate({
|
||||
errorElement: 'div',
|
||||
errorClass: 'invalid-feedback',
|
||||
|
||||
errorPlacement: function (error, element) {
|
||||
error.insertAfter(element);
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).removeClass('is-valid').addClass('is-invalid'); // add the Bootstrap error class to the control group
|
||||
},
|
||||
|
||||
<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>
|
||||
|
||||
ignore: "<?= $validator['ignore']; ?>",
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
unhighlight: function (element) {
|
||||
$(element).removeClass('is-invalid').addClass('is-valid');
|
||||
},
|
||||
|
||||
success: function (element) {
|
||||
$(element).removeClass('is-invalid').addClass('is-valid'); // remove the Boostrap error class from the control group
|
||||
},
|
||||
|
||||
focusInvalid: true,
|
||||
<?php if (Config::get('jsvalidation.focus_on_error')): ?>
|
||||
invalidHandler: function (form, validator) {
|
||||
|
||||
if (!validator.numberOfInvalids())
|
||||
return;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $(validator.errorList[0].element).offset().top
|
||||
}, <?= Config::get('jsvalidation.duration_animate') ?>);
|
||||
|
||||
},
|
||||
<?php endif; ?>
|
||||
|
||||
rules: <?= json_encode($validator['rules']); ?>
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,55 @@
|
||||
<script>
|
||||
jQuery(document).ready(function () {
|
||||
|
||||
$("<?= $validator['selector']; ?>").each(function () {
|
||||
$(this).validate({
|
||||
errorElement: 'span',
|
||||
errorClass: 'uk-text-danger',
|
||||
|
||||
errorPlacement: function (error, element) {
|
||||
if (element.closest('.uk-input').length ||
|
||||
element.closest('.uk-select').length || element.closest('.uk-textarea').length ||
|
||||
element.prop('type') === 'checkbox' || element.prop('type') === 'radio') {
|
||||
error.insertAfter(element.parent());
|
||||
// else just place the validation message immediately after the input
|
||||
} else {
|
||||
error.insertAfter(element);
|
||||
}
|
||||
},
|
||||
highlight: function (element) {
|
||||
$(element).closest('.uk-input').removeClass('uk-form-success').addClass('uk-form-danger'); // add the Bootstrap error class to the control group
|
||||
},
|
||||
|
||||
<?php if (isset($validator['ignore']) && is_string($validator['ignore'])): ?>
|
||||
|
||||
ignore: "<?= $validator['ignore']; ?>",
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
unhighlight: function (element) {
|
||||
$(element).closest('.uk-input').removeClass('uk-form-danger').addClass('uk-form-success');
|
||||
},
|
||||
|
||||
success: function (element) {
|
||||
$(element).closest('.uk-input').removeClass('uk-form-danger').addClass('uk-form-success'); // remove the Boostrap error class from the control group
|
||||
},
|
||||
|
||||
focusInvalid: true,
|
||||
<?php if (Config::get('jsvalidation.focus_on_error')): ?>
|
||||
invalidHandler: function (form, validator) {
|
||||
|
||||
if (!validator.numberOfInvalids())
|
||||
return;
|
||||
|
||||
$('html, body').animate({
|
||||
scrollTop: $(validator.errorList[0].element).offset().top
|
||||
}, <?= Config::get('jsvalidation.duration_animate') ?>);
|
||||
|
||||
},
|
||||
<?php endif; ?>
|
||||
|
||||
rules: <?= json_encode($validator['rules']); ?>
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user