I am trying to use a variable in a javascript function written as onClick attribute in button element but it's not working out
The javascript function I am trying to trigger when user click on the button element
updateForm(variableHere);
Variable is $dealer->id
This is how I am trying to do
@if ($dealer->user->activated==true)
{{ sprintf(Form::button('%s', ['class' => 'edit', 'style' => 'border: none; background: none; padding: 0px;', 'onClick' => 'updateForm(%s)']),'<i class="fa fa-eye-slash"></i>', '{{{ $dealer->id }}}') }}
@endif
{{ Form::open(['route' => ['dealers.status', $dealer->id], 'id' => 'update-status-'.$dealer->id ]) }}
{{ Form::close() }}
but getting this when I check the element's source code
<button fa-eye-slash"="" fa="" onclick="updateForm(<i class=" style="border: none; background: none; padding: 0px;" class="edit">)" type="button"><!--?php echo e($dealer--->id); ?></button>
What am I doing wrong here?