Fix error field highlighting, closes #90

This commit is contained in:
Dane Everitt 2016-09-27 17:32:34 -04:00
parent c95a058638
commit a8fd7283ef
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
3 changed files with 24 additions and 10 deletions

View file

@ -200,9 +200,9 @@
@if (count($errors) > 0)
@foreach ($errors->all() as $error)
<?php preg_match('/^The\s(.*?)\s/', $error, $matches) ?>
<?php preg_match('/^The\s(.*?)\sfield/', $error, $matches) ?>
@if (isset($matches[1]))
$('[name="{{ $matches[1] }}"]').parent().parent().addClass('has-error');
$('[name="{{ str_replace(' ', '_', $matches[1]) }}"]').parent().parent().addClass('has-error');
@endif
@endforeach
@endif