Skip to main content
August 16, 2023
Question

Email Validation on paragraph field

  • August 16, 2023
  • 5 replies
  • 0 views

In paragraph text , I want email validation

test1@gmail.com
test2@gmail.com
test3@gmail.com
test@test,com---(error)

I would like to have email validation in such a way that it should accept only email like test@gmail.com ,only gmail.com mails it should validate and if it doesn't have gmail.com at the end then throw error at the line
( @test.com in our case )

    5 replies

    mathieud0001
    August 16, 2023

    Why not use a grid instead of 1 paragraph field that holds many values?

    sabat0002Author
    August 16, 2023

    I need to paste all emails in paragraph field

    mathieud0001
    August 16, 2023

    Why?

    stewart.burchell
    August 16, 2023

    You can split the paragraph field's value into its individual lines (use char(10) as the separator) and then you will have an array that you can loop over and conduct your email validation logic over. You won't be able to highlight any erroneous values but you could call out the line number and the value in your validation error message.

    I'm with [mention:f5e81b8502fa4e77ad12697686a4fc56:e9ed411860ed4f2ba0265705b8793d05] though - you'd be better off with a grid of separate email values. I'd challenge the "requirement" as it sounds more like a solution.