PricingBlog

Validate that input actually is an email-address

  • larshaehre-1259488938654171248

    Lars Hæhre

    1 year ago

    What is the best way to validate that an input actually is an email-address? Using this when signing up a user.

    I wanted to validate it before I run the API to the database (in order to avoid error message from database).
  • larshaehre-1259495658189230100

    Lars Hæhre

    1 year ago

    I ended up creating a custom formula that uses this Regular expression matching: ^[\w-.]+@([\w-]+.)+[\w-]{2,4}$

    Looks like it works fine!
    1259495657949888562-image.png
  • lucasg-1259505758425579591

    Lucas G

    1 year ago

    Go on the attribute tab of your input and change the type to email
  • On the dropdown
  • HTML handles basic validation on its own
  • lucasg-1259506329031016590

    Lucas G

    1 year ago

    You can also add the required attribute so it cannot be blank
    👍2