Added array validation to ProcessFormErrors

This commit is contained in:
Jesper Jacobsen 2016-06-23 16:24:22 +02:00
parent 8e3338dbc7
commit a44e951f72
2 changed files with 4 additions and 2 deletions

View File

@ -163,7 +163,8 @@ function processFormErrors($form, errors)
{
$.each(errors, function (index, error)
{
var $input = $(':input[name=' + index + ']', $form);
var selector = (index.indexOf(".") >= 0) ? '.' + index.replace(/\./g, "\\.") : ':input[name=' + index + ']';
var $input = $(selector, $form);
if ($input.prop('type') === 'file') {
$('#input-' + $input.prop('name')).append('<div class="help-block error">' + error + '</div>')

View File

@ -4066,7 +4066,8 @@ function processFormErrors($form, errors)
{
$.each(errors, function (index, error)
{
var $input = $(':input[name=' + index + ']', $form);
var selector = (index.indexOf(".") >= 0) ? '.' + index.replace(/\./g, "\\.") : ':input[name=' + index + ']';
var $input = $(selector, $form);
if ($input.prop('type') === 'file') {
$('#input-' + $input.prop('name')).append('<div class="help-block error">' + error + '</div>')