Fix error field highlighting, closes #90
This commit is contained in:
parent
c95a058638
commit
a8fd7283ef
3 changed files with 24 additions and 10 deletions
|
@ -99,7 +99,7 @@
|
|||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="memory_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="memory_overallocate" class="form-control" value="{{ old('memory_overallocate') }}"/>
|
||||
<input type="text" name="memory_overallocate" class="form-control" value="{{ old('memory_overallocate', 0) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -124,7 +124,7 @@
|
|||
<div class="form-group col-md-6 col-xs-6">
|
||||
<label for="disk_overallocate" class="control-label">Overallocate</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="disk_overallocate" class="form-control" value="{{ old('disk_overallocate') }}"/>
|
||||
<input type="text" name="disk_overallocate" class="form-control" value="{{ old('disk_overallocate', 0) }}"/>
|
||||
<span class="input-group-addon">%</span>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue