File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,6 @@ public function init()
5353 }
5454
5555
56-
5756 /**
5857 * @inheritdoc
5958 */
@@ -73,17 +72,21 @@ public function run()
7372 return
7473 Html::tag ('script ' , <<<JS
7574 var recaptchaCallback_ {$ callbackRandomString } = function() {
76- grecaptcha.ready(function() {
77- grecaptcha.execute(' {$ this ->_component ->site_key }', {action: ' {$ this ->actionName }'}).then(function(token) {
78- alert(token);
79- $('# {$ inputId }').val(token);
80- $('# {$ formId }').submit();
81- });
82- });
75+ if(!$('# {$ inputId }').val()){
76+ grecaptcha.ready(function() {
77+ grecaptcha.execute(' {$ this ->_component ->site_key }', {action: ' {$ this ->actionName }'}).then(function(token) {
78+ alert(token);
79+ $('# {$ inputId }').val(token);
80+ $('# {$ formId }').submit();
81+ });
82+ });
83+ }else{
84+ $('# {$ formId }').submit();
85+ }
8386 }
8487JS
8588 )
8689 . Html::activeHiddenInput ($ this ->model , $ this ->attribute )
87- . Html::button ($ this ->buttonText , $ this -> options );
90+ . Html::button ($ this ->buttonText , $ options );
8891 }
8992}
You can’t perform that action at this time.
0 commit comments