Home › Forums › Quform PHP › Submitting the form gives ‘type_the_word’ does not exist error
- This topic has 1 reply, 2 voices, and was last updated 4 years, 11 months ago by Ally.
- AuthorPosts
- May 7, 2019 at 3:20 pm #29217DigitalEssenceParticipant
Hi,
I’ve removed the default Captcha and have added a Google reCAPTCHA instead but when i submit the form I get a Warning pop up that says:
” Element ‘type_the_word’ does not exist in the HTML but is being validated, you must also remove the element configuration from process.php”
If I remove the relevant lines from process.php I can no longer submit the form even when the reCAPTCHA has been completed.
/**
* Configure the CAPTCHA element
* Filters: Trim
* Validators: Required, Identical
*/
$captcha = new Quform_Element(‘type_the_word’, ‘Type the word’);
$captcha->addFilter(‘trim’);
$captcha->addValidator(‘required’);
$captcha->addValidator(‘identical’, array(‘token’ => ‘catch’));
$captcha->setIsHidden(true);
$form->addElement($captcha);/** Google reCAPTCHA **/
$recaptcha = new Quform_Element(‘g-recaptcha-response’, ‘reCAPTCHA’);
$recaptcha->addValidator(‘required’);
$recaptcha->addValidator(‘recaptcha’, array(‘secretKey’ => ‘My site key goes here’));
$recaptcha->setIsHidden(true);
$form->addElement($recaptcha);And my form html:
<!– Begin Captcha element –>
<div class=”quform-element quform-element-recaptcha”>
<div class=”quform-spacer”>
<label>Are you human? <span class=”quform-required”>*</span></label>
<div class=”quform-input”>
<div class=”g-recaptcha” data-sitekey=”6LfpOKIUAAAAAPp6S1huUuTlhfBlQ-4hx6446-mr”></div>
<noscript>Please enable JavaScript to submit this form.</noscript>
</div>
</div>
</div>
<!– End Captcha element –>Thanks
May 10, 2019 at 3:44 pm #29253AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.