diff --git a/README.md b/README.md index 613bdbd..1925dd0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ echo form_close(); ``` helper(['form', 'reCaptcha']); -echo form_open(); +echo form_open('/form_processing_path', array('id' => 'contactForm')); echo reCaptcha3('reCaptcha3', ['id' => 'recaptcha_v3'], ['action' => 'contactForm']); @@ -71,6 +71,10 @@ public $validationRules = [ ]; ``` -In the settings of the reCaptcha3 validator, the first parameter you specify is expectedAction, this parameter is not required. +In the settings of the reCaptcha3 validator, the first parameter you specify is +expectedAction. The form id attribute needs to share the same name as the action. +This allows grecaptcha.execute to be called on form submission to prevent token +expiration warnings. -You can override a global scoreThreshold parameter in the second reCaptcha3 rule parameter. \ No newline at end of file +You can override a global scoreThreshold parameter in the second reCaptcha3 rule +parameter. diff --git a/Views/init_v3.php b/Views/init_v3.php index edee83a..d62ef34 100644 --- a/Views/init_v3.php +++ b/Views/init_v3.php @@ -7,10 +7,25 @@ \ No newline at end of file +