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 7923143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T17:12:36+00:00 2026-06-03T17:12:36+00:00

I have a domain class for user registration. During the registration, user needs to

  • 0

I have a domain class for user registration. During the registration, user needs to enter email twice, and those two needs to match. I do not want to store re-entered email and just want to use that for verification. Any suggestion?

My domain class looks like:

class MyUser{

    String name
    String email
    Integer telephone
 }

and my view looks like:

<label for="reEmail" id="reEmail">
<g:message code="myUser.reEnter.label" default="Re-enter Email:" id="reEnter"/></label>
<g:textField name="reEmail"/>

Thanks in advance

  • 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-03T17:12:39+00:00Added an answer on June 3, 2026 at 5:12 pm

    A good way to handle this is to use a transient field in your class.

    Like so….

    class MyUser{
    
        static constraints = {
          email (email: true, blank: false) //<-- just a good idea ;)
        }
    
        String name
        String email
        Integer telephone
        String emailAgain
        static transients = ['emailAgain'] //<-- won't be stored in the database
    
     }
    

    Then, in you view you can deal with the field just like any other…

    <g:textField name="email" />
    <g:textField name="emailAgain" />
    

    Then just validate it in your controller…

    def save = {
       def myUser = new MyUser(params);
       if (myUser.email.equals(myUser.emailAgain)){ //<-- maybe make a helper method in the domain class (myUser.doesEmailMatchEmailAgain() ?)
         // do stuff
       }else{
         //handle error, tell user their email's don't match
       }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have table user(id,name,address) and User domain class.i want to get only the name
I have two domain classes: User : class User { String login String password
I have added the following method in my User Domain class String getNameAttribute(){ return
I have an Integer rankOnHighlights property in my Project domain class. I want to
I have two domain classes. class BillingServiceGroup { Integer billingServiceGroupCode String billingServiceGrpDesc String status
Let's say I have a domain class called User which can follow other User
Suppose you have the following domain classes class User { static hasMany = [books:Book]
I have the following java class: package domain; //imports @Entity public class User {
Say I have a user domain class with fields username and password . For
Let's say you have a domain entity User and you want to support the

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.