Changeset View
Changeset View
Standalone View
Standalone View
src/resources/js/app.js
Show First 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | error => { | ||||
const input_name = (form.data('validation-prefix') || form.find('form').first().data('validation-prefix') || '') + idx | const input_name = (form.data('validation-prefix') || form.find('form').first().data('validation-prefix') || '') + idx | ||||
let input = form.find('#' + input_name) | let input = form.find('#' + input_name) | ||||
if (!input.length) { | if (!input.length) { | ||||
input = form.find('[name="' + input_name + '"]'); | input = form.find('[name="' + input_name + '"]'); | ||||
} | } | ||||
if (input.length) { | if (input.length) { | ||||
// Create an error message\ | // Create an error message | ||||
// API responses can use a string, array or object | // API responses can use a string, array or object | ||||
let msg_text = '' | let msg_text = '' | ||||
if ($.type(msg) !== 'string') { | if ($.type(msg) !== 'string') { | ||||
$.each(msg, (index, str) => { | $.each(msg, (index, str) => { | ||||
msg_text += str + ' ' | msg_text += str + ' ' | ||||
}) | }) | ||||
} | } | ||||
else { | else { | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |