Skip to content

Commit

Permalink
Fixed send creds checkbox in create user form
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Nov 3, 2020
1 parent 12667f4 commit df5972c
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions resources/views/users/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ class="form-control"
</div>
@else
<div style="padding-left: 10px;">
<input type="checkbox" value="1" name="activated" class="minimal" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} aria-label="activated">
<input type="checkbox" value="1" id="activated" name="activated" class="minimal" {{ (old('activated', $user->activated)) == '1' ? ' checked="checked"' : '' }} aria-label="activated">
{{ trans('admin/users/general.activated_help_text') }}
</div>
@endif
Expand All @@ -387,7 +387,7 @@ class="form-control"

<!-- Email user -->
@if (!$user->id)
<div class="form-group" id="email_user_row" style="display: none;">
<div class="form-group" id="email_user_row">
<div class="col-sm-3">
</div>
<div class="col-md-9">
Expand Down Expand Up @@ -534,24 +534,26 @@ class="form-control">
<script nonce="{{ csrf_token() }}">
$(document).ready(function() {
$('#user_activated').on('ifChecked', function(event){
$('#activated').on('ifChecked', function(event){
console.log('user activated is checked');
$("#email_user_row").show();
$('#email').on('keyup',function(){
event.preventDefault();
if(this.value.length > 5){
$('#email_user_checkbox').iCheck('enable');
} else {
$('#email_user_checkbox').iCheck('disable').iCheck('uncheck');
}
});
});
$('#user_activated').on('ifUnchecked', function(event){
$('#activated').on('ifUnchecked', function(event){
$("#email_user_row").hide();
});
$('#email').on('keyup',function(){
event.preventDefault();
if(this.value.length > 5){
$('#email_user_checkbox').iCheck('enable');
} else {
$('#email_user_checkbox').iCheck('disable').iCheck('uncheck');
}
});
// Check/Uncheck all radio buttons in the group
$('tr.header-row input:radio').on('ifClicked', function () {
value = $(this).attr('value');
Expand Down

0 comments on commit df5972c

Please sign in to comment.