Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7943099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T00:10:15+00:00 2026-06-04T00:10:15+00:00

I have these lines of code to validate for an e-mail address: <h:outputText value=#{labels.eMail}:

  • 0

I have these lines of code to validate for an e-mail address:

<h:outputText value="#{labels.eMail}: " />
<p:inputText size="30" maxlength="50" validatorMessage="Please provide a valid e-mail address" value="#{personelView.eMail}">
  <f:validateRegex pattern=".+@.+\.[a-zA-Z]+" />
</p:inputText>

When I leave the e-mail address field empty and submit the form it gives validation error. Why JSf is doing this? Isn’t it supposed to just validate e-mail field with the above code? I even tried adding:

required="false" 

still no good. Does anyone have any idea about this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T00:10:16+00:00Added an answer on June 4, 2026 at 12:10 am

    your inputText value is being validated against your <f:validateRegex pattern=".+@.+\.[a-zA-Z]+" /> and if its value not valid you getting the error , so you need to improve your regex so it will match your pattern or accept empty string…

    So wrapping it with () and adding a ? should do the job

    Try

    <f:validateRegex pattern="(.+@.+\.[a-zA-Z]+)?"/>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created some code that emails an html email to a given address.
I have these lines in my ~/.inputrc : set editing-mode vi set keymap vi
I have these (sample) lines in a HTML-file: test.ABC.test test.ABCD.test test.ABCE.test And this Ant
I have defined a custom file type with these lines: syn region SubSubtitle start=+=+
I have a txt file that created in notepad , containing these lines for
How can I have each of these a elements break on to new lines,
I'm attempting to use 'jQuery Validate' on a form that requires an email address
For example we have this line chart at Google Code API there is a
I have there lines in my RegisterToutes : routes.MapRoute(Pages3, {url1}/{url2}/{url3}, MVC.Page.RedirectTo(), new { url1
I have these links : Block 1 : <a href=/Products?dep=56&cat=252&tab=2>Adapters</a> <a href=/Products?dep=58&cat=654&tab=2>Battery</a> After click

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.