Skip to content

Commit

Permalink
Merge pull request #3 from onfire/class-fix
Browse files Browse the repository at this point in the history
update js to allow extending base class, as well as allowing $validator to be passed to parent
  • Loading branch information
Meldgaard authored May 6, 2019
2 parents 0279ae7 + 348c4cd commit 4f87b43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion js/recaptcha.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
window.addEventListener("load",function() {
document.getElementById('RecaptchaForm_'+'$formName').addEventListener('submit', function (event) {
document.getElementById('$formName').addEventListener('submit', function (event) {
event.preventDefault(); //stop form from submitting
var submittedForm = event.target;
// needs for recaptacha ready
Expand Down
2 changes: 1 addition & 1 deletion src/Form/RecaptchaField.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function Field($properties = array())
"siteKey" => $this->getSiteKey(),
"customFunction" => $this->customFunction,
"customNameFunction" => $this->customFunctionName,
"formName" => $this->getForm()->name
"formName" => $this->getForm()->FormName()
];

$recaptchaJs = 'https://www.google.com/recaptcha/api.js?render='.$this->getSiteKey();
Expand Down
3 changes: 2 additions & 1 deletion src/Form/RecaptchaForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function __construct(RequestHandler $controller = null,$name,FieldList $f
$controller,
$name,
$formFields,
$formActions
$formActions,
$validator
);
}
}

0 comments on commit 4f87b43

Please sign in to comment.