Email confirm validation

Home Forums Quform WordPress Email confirm validation

This topic is: resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #23719
    Sweeps
    Participant

    Hi,

    i have followed the guide here – https://support.themecatcher.net/quform-wordpress-v2/guides/customization/confirm-email-field
    and opted to create a plugin rather than editing the functions file and this is the code:

    
    <?php
    /*
     * Plugin Name: Quform Custom Code Move Form
     * Description: Custom code for Quform Move Form.
     * Version: 1.0
     */
     
    // Paste in your custom code below
    
    add_filter('quform_5_5', function ($valid, $value, Quform_Element_Email $element) {
        if ($value != $element->getForm()->getValue('quform_5_21')) {
            $element->setError('The email addresses do not match');
            $valid = false;
        }
     
        return $valid;
    }, 10, 3);
    

    I have tried with and without the ‘quform_’ text before the unique ID but can’t seem to get it to work. Is there something I am doing wrong?

    Thanks in advance,

    Sweeps

    • This topic was modified 7 years, 6 months ago by Sweeps. Reason: Forgot to tick notify on response
    Attachments:
    You must be logged in to view attached files.
    #23733
    Venom
    Participant

    Please try to rename ‘quform_5_5’ to ‘quform_element_valid_5_5’

    #23737
    Sweeps
    Participant

    Hi,

    With your recommended change I get

    ‘There was a problem
    The response from the server was invalid or malformed’

    This is the form – http://new.paymentspro.co.uk/moving-umbrella/

    • This reply was modified 7 years, 6 months ago by Sweeps.
    #23773
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #23782
    Sweeps
    Participant

    Still not joy so set debug mode and this is the error in the log –

    [10-Jan-2018 09:43:23 UTC] PHP Catchable fatal error: Argument 3 passed to my_confirm_email() must be an instance of Quform_Element_Email, instance of Quform_Element_Text given in /var/www/vhosts/paymentspro.co.uk/new.paymentspro.co.uk/wp-content/plugins/quform-custom-code-move/quform-custom-code-move.php on line 11

    #23788
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #23793
    Sweeps
    Participant

    Doh! Working now. Many thanks and apologies for my daftness.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy