'This field is required' doesn't go away when …

Home Forums Quform PHP 'This field is required' doesn't go away when …

This topic is: resolved

This topic contains 10 replies, has 2 voices, and was last updated by  bb3 2 months, 1 week ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #27532

    bb3
    Participant

    … the field is filled in.
    should this message not disappear, when the field is corrected?
    The validation works fine, displaying the error messages when a required field is omitted. But, when you correct the field, the error message stays on. How can it be turned off at that point?

    #27548

    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.

    #27555

    bb3
    Participant

    Hi Ally,
    Thanks for that.
    Must say, I don’t understand the design decision … it’s not the kind of form-filling behaviour I would be familiar with as a user.
    If error messages still remain, when a field is ‘corrected’, it indicates to the user they are still doing something wrong, so it’s confusing.

    The new code doesn’t remove the error messages – it only allows the form to submit, which is not the outcome I was hoping for.
    Is there a way to remove the messages as the fields are being corrected?
    Regards
    bb

    #27569

    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.

    #27580

    bb3
    Participant

    Hi,
    Thanks. Much appreciated.
    Getting there now … it works … but not on the drop-down fields where you have to select an option.
    Still somewhat of a crude solution – the error message disappears even without a proper email address format, although won’t submit the form until corrected. Still, it’s better than it was for sure. I’ll find a solution for that issue myself.
    I would be ok with it for now if it also took care of the select drop-down lists.

    Cheers!
    And thanks for you patience
    bb

    #27599

    bb3
    Participant

    Another thing on the validation:
    I read the advanced section and put this in process php

    $email = new Quform_Element('email', 'Email address');
    $email->addFilter('trim');
    $email->addValidator('required');
    $email->addValidator('email', array(
        'messages' => array('invalid' => 'The email address %s is invalid')
    ));

    Quote from the documentation:
    “If the value is not valid, the error messages generated by the Validator will be returned back to the user and the form will not be submitted.”
    I can’t get anything returned to the user (when using an obviously incorrect), no matter what I do.
    I am using my own form, but, in case it mattered, I even tried wrapping that email field in everything – quform element, quform spacer etc – everything that appears in the examples. Still no message? I’m flummoxed!

    #27606

    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.

    #27607

    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.

    #27611

    bb3
    Participant

    Hi Ally
    Thanks for all of that.
    Much appreciated again.

    The email field I have in the form is already as you suggest:
    <input name="email" type="email" id="email" placeholder="your email address" />
    I thought the email address validator file in the quform lib folder took care of validation the email address? Maybe another step is needed … ?

    I will send the files …

    Thank you
    BB

    #27659

    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.

    #27666

    bb3
    Participant

    Very helpful information here, many thanks once again. Loads of info to digest in the link as well.
    So, modern browsers do email validation automatically, even if limited. Mine is a bit old so I’m still getting the quform-error message when trying your first example using the word ‘test’ above.

    Before getting the updated ‘scripts’ code, and to achieve consistency, I removed all validation from the process file, except for the email. I even gave that email field the advanced treatment as per instructions in the documentation.

    Testing it didn’t produce any error message at all! Nothing! I still don’t know why, but after now adding back in all the other validation as I originally had it in the process file, everything is working again, email as well. So, the previous scenario can remain a mystery.

    Thank you for the updated scripts code. The form is looking a lot more consistent now. Really appreciated.

    Kind regards
    bb

Viewing 11 posts - 1 through 11 (of 11 total)

You must be logged in to reply to this topic.

Be inspired. © 2018 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy