'laravel blade confirmation alert for multi language support
I am trying to add multi-language to a laravel project.
I am having a problem with applying the confirmation alert.
For example,
onclick="confirm( {{ __('Are you sure you want to remove this method? The payment records will not be deleted.') }} ) ? this.parentElement.submit() : '' "
in
<form action="{{ route('methods.destroy', $method) }}" method="post" class="d-inline">
@csrf
@method('delete')
<button type="button" class="btn btn-link" data-toggle="tooltip" data-placement="bottom" title="{{ __('Delete Method') }}" onclick=" confirm( {{ __('Are you sure you want to remove this method? The payment records will not be deleted.') }} ) ? this.parentElement.submit() : '' ">
<i class="tim-icons icon-simple-remove"></i>
</button>
</form>
is not throwing Uncaught SyntaxError: missing ) after argument list error.
But as you can see, ) is there.
please help.
Solution 1:[1]
brombeer's answer.
'missing qoutes inside confirm()'
onclick="confirm( '{{ __('Are you sure you want to remove this method? The payment records will not be deleted.')' }} ) ? this.parentElement.submit() : '' "
Worked! Thank you brombeer :)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | hyukkyulee |
