Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit cc8a023

Browse files
committed
w3 validation fix
1 parent 6fdb334 commit cc8a023

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

Diff for: ReCaptcha.php

+13-11
Original file line numberDiff line numberDiff line change
@@ -120,21 +120,23 @@ public function run()
120120
if (reCaptcha.data("recaptcha-client-id") === undefined) {
121121
var recaptchaClientId = grecaptcha.render(reCaptcha.attr("id"), {
122122
"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");
125126
} else {
126-
jQuery("#" + reCaptcha.attr("input-id")).val(response).trigger("change");
127+
jQuery("#" + reCaptcha.data("input-id")).val(response)
128+
.trigger("change");
127129
}
128130
129131
if (reCaptcha.attr("data-callback")) {
130132
eval("(" + reCaptcha.attr("data-callback") + ")(response)");
131133
}
132134
},
133135
"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("");
136138
} else {
137-
jQuery("#" + reCaptcha.attr("input-id")).val("");
139+
jQuery("#" + reCaptcha.data("input-id")).val("");
138140
}
139141
140142
if (reCaptcha.attr("data-expired-callback")) {
@@ -242,20 +244,20 @@ protected function buildDivOptions()
242244
if (isset($this->widgetOptions['class'])) {
243245
$divOptions['class'] = "{$divOptions['class']} {$this->widgetOptions['class']}";
244246
}
245-
$divOptions['input-id'] = $this->getReCaptchaId();
247+
$divOptions['data-input-id'] = $this->getReCaptchaId();
246248

247249
if ($this->field !== null && $this->field->form !== null) {
248250
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'];
250252
} else {
251-
$divOptions['form-id'] = $this->field->form->id;
253+
$divOptions['data-form-id'] = $this->field->form->id;
252254
}
253255
} else {
254-
$divOptions['form-id'] = '';
256+
$divOptions['data-form-id'] = '';
255257
}
256258

257259
$divOptions['id'] = $this->getReCaptchaId() . '-recaptcha' .
258-
($divOptions['form-id'] ? ('-' . $divOptions['form-id']) : '');
260+
($divOptions['data-form-id'] ? ('-' . $divOptions['data-form-id']) : '');
259261

260262
return $divOptions;
261263
}

0 commit comments

Comments
 (0)