PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Blank email validation message

  1. ghalleb
    Member

    Hi,

    I'm happy with the validation message for email field when the email is misformed.
    But is there a way to print the same message when the email is blank (without setting it to required because it will make the form failed but without the same message under the field)

    Cheers

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  2. David Peralty
    Administrator

    Can you give me more information on what you want to do? Why isn't making it required a good way to allow you to have a validation message for the e-mail field? The malformed e-mail address stops the form from submitting as well.

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  3. ghalleb
    Member

    The malformed e-mail address validation stop the form in a more proper way for what I need.
    Just a matter of taste....

    Please take a look at my website: http://www.wisedome.org/ make the 2 tests (blank and malformed), I think you'll understand why I prefer the email validation against global validation message!

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  4. David Peralty
    Administrator

    Ah, I understand now. The malformed e-mail address is using JQuery to test to see if it is valid or not. You would have to come up with custom JS to test to see if blank.

    Something like this:
    http://stackoverflow.com/questions/1854556/how-to-check-if-inputs-are-empty-with-jquery

    My JQuery knowledge is fairly limited, so I am not sure how we have ours currently set-up to show the malformed warning. I'll check into that for you.

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  5. David Peralty
    Administrator

    After a quick check, I can say, that the tooltip you see isn't generated by Gravity Forms. This seems like something custom to your theme.

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  6. ghalleb
    Member

    I enabled HTML5 in the GravityForms parameters, that's why we see the tooltip.

    I'll check further and come back to you if I have a question....

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  7. ghalleb
    Member

    In fact, it would be usefull to add the property required="required" when the field is required...
    It's a attribut for email type input in html5.

    Perhaps you could ask the developpers if it's plan, or give me a hint to know what I have to hack.

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink
  8. ghalleb
    Member

    I managed to had $html5_attributes = "required = 'required'"; in common.php for email type, because all the email input type I use should not be empty.

    A little bit of code in your part could be usefull for people using the html5 option for gravity...

    Cheers

    Posted 7 years ago on Wednesday July 18, 2012 | Permalink