HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/centrum8a/centrum8a.com/resources/views/kms/attributes/currency.blade.php
<div class="entity-attribute entity-attribute-currency {!! $attribute->getStyleClass() !!}   @if($errors->has((string)$attribute->getKey())) error @endif {!!$attribute->getStyleClass()!!}"
     {{--{{ dd($errors->get((string)$attribute->getKey())) }}--}}
     data-uk-tooltip="{pos:'bottom-right'}"
     title="{{ $errors->get((string)$attribute->getKey()) != [] ? $errors->get((string)$attribute->getKey())[0] : ''}}"
>
    <label for="{{ $attribute->getKey() }}">{{ $attribute->getLabelText() }}</label>
    @if($attribute->getReadOnly())
        <div class="content">{!! $attribute->getValue() !!}</div>
        <input type="hidden" name="{{ $attribute->getKey() }}">
    @else
        <input type="number"
               data-forInput="{{ $attribute->getKey() }}"
               @if($attribute->getMin() !== null) min="{{$attribute->getMin()}}" @endif
               @if($attribute->getMax()) max="{{$attribute->getMax()}}" @endif
               @if($attribute->getStep()) step="{{$attribute->getStep()}}" @endif
        >
        <input type="hidden" value="" name="{{ $attribute->getKey() }}">
        @if($attribute->getExplanation())<span class="explanation">{{ $attribute->getExplanation() }}</span> @endif
@endif
</div>
<script>
(function() {
let realInputSelector = 'input[name="{{ $attribute->getKey() }}"]';
let fakeInputSelector = 'input[data-forInput="{{ $attribute->getKey() }}"]';

let realInput = document.querySelector(realInputSelector);
let fakeInput = document.querySelector(fakeInputSelector);

if("{{ $attribute->getValue() }}" !== "")
{
    realInput.setAttribute('value', {{ (int)$attribute->getValue() }});
    fakeInput.setAttribute('value', {{ (int)$attribute->getValue() / 100 }});
}

fakeInput.addEventListener('change', (event) => {
    realInput.value = event.target.value * 100;
});
})()
</script>