Skip to content

Commit

Permalink
added check id
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanDaDeng committed Jan 26, 2019
1 parent 94c670b commit 3c3d2de
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions resources/views/googlerecaptchav3/template.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@
function onloadCallback() {
@foreach($mappers as $action=>$fields)
@foreach($fields as $field)
let client{{$field}} = grecaptcha.render('{{$field}}', {
'sitekey': '{{$publicKey}}',
@if($inline===true) 'badge': 'inline', @endif
'size': 'invisible',
'hl': '{{$language}}'
});
grecaptcha.ready(function () {
grecaptcha.execute(client{{$field}}, {
action: '{{$action}}'
});
});
if (document.getElementById('{{$field}}')) {
let client{{$field}} = grecaptcha.render('{{$field}}', {
'sitekey': '{{$publicKey}}',
@if($inline===true) 'badge': 'inline', @endif
'size': 'invisible',
'hl': '{{$language}}'
});
grecaptcha.ready(function () {
grecaptcha.execute(client{{$field}}, {
action: '{{$action}}'
});
});
}
@endforeach
@endforeach
}
Expand Down

0 comments on commit 3c3d2de

Please sign in to comment.