e-mail validation

Viewing 4 reply threads
  • Author
    Posts
    • #15014
      Carl L
      Participant

      Our volunteers are sometimes leaving spaces before or after the e-mail addresses. This creates an ‘invalid’ email error, but when the form reloads, the e-mail seems to be trimmed. Can the php ‘trim’ be done before the validation?

    • #15018
      Stephen Sherrard
      Keymaster

      My form doesn’t use trim on those POST values when displayed, but it does use the proper WordPress sanitizing function of esc_attr for POSTed input values, which does several santization functions which must also trim extra white space as well.

      However, your idea of trimming before validating that’s it’s a valid email is a good one. Should probably trim all posted values before validating, just to avoid some additional frustration.

    • #15026
      Carl L
      Participant

      Thanks!

    • #15032
      Carl L
      Participant

      I also should have mentioned that my evaluations were done for an authenticated user. When the failed submission reloaded for me, the spaces were gone. The authentication may have affected the way the e-mail address was reloaded upon a failed submission. (I added spaces based on reports from some volunteers that they could not see a problem in the e-mail address that they were trying to submit, so it occurred to me to check spaces.)

    • #15080
      Stephen Sherrard
      Keymaster

      Fixed in version 2.0.3

Viewing 4 reply threads
  • The topic ‘e-mail validation’ is closed to new replies.