File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed
resources/views/googlerecaptchav3 Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change 23
23
function onloadCallback () {
24
24
@foreach ($mappers as $action => $fields )
25
25
@foreach ($fields as $field )
26
- let client{{ $field } } = grecaptcha .render (' {{ $field } }' , {
27
- ' sitekey' : ' {{ $publicKey } }' ,
28
- @if ($inline === true ) ' badge' : ' inline' , @endif
29
- ' size' : ' invisible' ,
30
- ' hl' : ' {{ $language } }'
31
- });
32
- grecaptcha .ready (function () {
33
- grecaptcha .execute (client{{ $field } } , {
34
- action: ' {{ $action } }'
35
- });
36
- });
26
+ if (document .getElementById (' {{ $field } }' )) {
27
+ let client{{ $field } } = grecaptcha .render (' {{ $field } }' , {
28
+ ' sitekey' : ' {{ $publicKey } }' ,
29
+ @if ($inline === true ) ' badge' : ' inline' , @endif
30
+ ' size' : ' invisible' ,
31
+ ' hl' : ' {{ $language } }'
32
+ });
33
+ grecaptcha .ready (function () {
34
+ grecaptcha .execute (client{{ $field } } , {
35
+ action: ' {{ $action } }'
36
+ });
37
+ });
38
+ }
37
39
@endforeach
38
40
@endforeach
39
41
}
You can’t perform that action at this time.
0 commit comments