@@ -120,21 +120,23 @@ public function run()
120
120
if (reCaptcha.data("recaptcha-client-id") === undefined) {
121
121
var recaptchaClientId = grecaptcha.render(reCaptcha.attr("id"), {
122
122
"callback": function(response) {
123
- if (reCaptcha.attr("form-id") !== "") {
124
- jQuery("#" + reCaptcha.attr("input-id"), "#" + reCaptcha.attr("form-id")).val(response).trigger("change");
123
+ if (reCaptcha.data("form-id") !== "") {
124
+ jQuery("#" + reCaptcha.data("input-id"), "#" + reCaptcha.data("form-id")).val(response)
125
+ .trigger("change");
125
126
} else {
126
- jQuery("#" + reCaptcha.attr("input-id")).val(response).trigger("change");
127
+ jQuery("#" + reCaptcha.data("input-id")).val(response)
128
+ .trigger("change");
127
129
}
128
130
129
131
if (reCaptcha.attr("data-callback")) {
130
132
eval("(" + reCaptcha.attr("data-callback") + ")(response)");
131
133
}
132
134
},
133
135
"expired-callback": function() {
134
- if (reCaptcha.attr ("form-id") !== "") {
135
- jQuery("#" + reCaptcha.attr ("input-id"), "#" + reCaptcha.attr ("form-id")).val("");
136
+ if (reCaptcha.data ("form-id") !== "") {
137
+ jQuery("#" + reCaptcha.data ("input-id"), "#" + reCaptcha.data ("form-id")).val("");
136
138
} else {
137
- jQuery("#" + reCaptcha.attr ("input-id")).val("");
139
+ jQuery("#" + reCaptcha.data ("input-id")).val("");
138
140
}
139
141
140
142
if (reCaptcha.attr("data-expired-callback")) {
@@ -242,20 +244,20 @@ protected function buildDivOptions()
242
244
if (isset ($ this ->widgetOptions ['class ' ])) {
243
245
$ divOptions ['class ' ] = "{$ divOptions ['class ' ]} {$ this ->widgetOptions ['class ' ]}" ;
244
246
}
245
- $ divOptions ['input-id ' ] = $ this ->getReCaptchaId ();
247
+ $ divOptions ['data- input-id ' ] = $ this ->getReCaptchaId ();
246
248
247
249
if ($ this ->field !== null && $ this ->field ->form !== null ) {
248
250
if (!empty ($ this ->field ->form ->options ['id ' ])) {
249
- $ divOptions ['form-id ' ] = $ this ->field ->form ->options ['id ' ];
251
+ $ divOptions ['data- form-id ' ] = $ this ->field ->form ->options ['id ' ];
250
252
} else {
251
- $ divOptions ['form-id ' ] = $ this ->field ->form ->id ;
253
+ $ divOptions ['data- form-id ' ] = $ this ->field ->form ->id ;
252
254
}
253
255
} else {
254
- $ divOptions ['form-id ' ] = '' ;
256
+ $ divOptions ['data- form-id ' ] = '' ;
255
257
}
256
258
257
259
$ divOptions ['id ' ] = $ this ->getReCaptchaId () . '-recaptcha ' .
258
- ($ divOptions ['form-id ' ] ? ('- ' . $ divOptions ['form-id ' ]) : '' );
260
+ ($ divOptions ['data- form-id ' ] ? ('- ' . $ divOptions ['data- form-id ' ]) : '' );
259
261
260
262
return $ divOptions ;
261
263
}
0 commit comments