Home › Forums › Quform PHP › Validation not working for some form elements
- This topic has 5 replies, 2 voices, and was last updated 6 years, 5 months ago by Ally.
- AuthorPosts
- May 26, 2018 at 5:22 am #25811sc688hshjParticipant
I am using Quform for a clients website and need to add a checkbox to ensure that visitors agree to teh clients terms and privacy statement. All of the main form elements are working, however, teh checkbox and reCaptcha are not validating.
I have added teh following to the contact.php page for teh client:
<div class=”form-group”>
<div class=”col-md-4″></div>
div class=”col-md-6″>
<label for=”single_checkbox”><input id=”single_checkbox” name=”single_checkbox” value=”1″ type=”checkbox” /> <span style=”font-size: 14px !important; “>I agree with Mosaic Project Services Pty. Ltd.Disclaimer and Privacy Policy</span> <span class=”quform-required”>*</span></label>
</div>
</div><div class=”form-group”>
<div class=”col-md-4″>
</div>
<div class=”col-md-6″>
<div class=”g-recaptcha” data-sitekey=”6LfTZi0UAAAAAKbTYAZkr-4govs0nDuPVHXxxowb”></div>
</div>
</div>I have also added the following to process.php
/**
* Configure the enquiry type element
* Filters: Trim
* Validators: Required
*/$single_checkbox = new Quform_Element(‘single_checkbox’, ‘Checkbox’);
$single_checkbox->addValidator(‘required’);
$form->addElement($single_checkbox);/**
* Configure the Google reCaptcha element
* Filters: Trim
* Validators: Required, Identical
*/$recaptcha = new Quform_Element(‘g-recaptcha-response’, ‘reCAPTCHA’);
$recaptcha->addValidator(‘required’);
$recaptcha->addValidator(‘recaptcha’, array(‘secretKey’ => ‘6LfTZi0UAAAAAKDTvz7Xd3GtJNwtQ32e2w9A09TW’));
$recaptcha->setIsHidden(true);
$form->addElement($recaptcha);I am not sure if has an impact but the form is being sent through mailgun.org.
On another note, I just tried downloading teh latest version of QuForm and the zip file does not contain the form files. It only contains teh documentation, resources and template.
Thanks,
Stuart
May 26, 2018 at 5:23 am #25812sc688hshjParticipantThanks
May 30, 2018 at 1:11 am #25850sc688hshjParticipantAny updates for this? I have not had any response and can’t find any information in your support documentation or forum.
May 30, 2018 at 2:12 pm #25862AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
May 31, 2018 at 12:21 am #25873sc688hshjParticipantHi Ali,
I have just sent an email to you.
May 31, 2018 at 8:58 pm #25910AllySupport 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.