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/SBogers70/inter-mill.com/workbench/komma/kms/src/views/attributes/onOff.blade.php
<div class="entity-attribute entity-attribute-on-off{{{ count($attribute->errors) == 0 ? '' : ' error' }}} {{{$attribute->class}}}" data-uk-tooltip="{pos:'bottom-right'}" title="{{{ $attribute->errors[0] or '' }}}">
    {{ Form::label($attribute->key. '_checkbox', $attribute->label) }}
    {{ Form::hidden($attribute->key, $attribute->getValue(), ['id' => $attribute->key]) }}
    {{ Form::checkbox($attribute->key.'_checkbox', '1', $attribute->getValue() == 1 ? true : false, ['class' => 'toggle toggle-round-flat', 'id' => $attribute->key . '_checkbox']) }}
    <label for="{{{$attribute->key . '_checkbox'}}}" class="toggle-label"></label>

    <script>
        $("#{{$attribute->key}}_checkbox").change(function(){
            $("#{{$attribute->key}}").val($(this).prop('checked') ? 1 : 0);
        });
    </script>

</div>