• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

wordings for error message

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
there is a name field ok. and it these are the conditions:
the first character should not be space followed by alphanumeric and no special characters allowed.

the above line is very long, i just want one short name for this conditions to display to the user when the user enters wrong characters in the name field
 
Ranch Hand
Posts: 129
Netbeans IDE Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Invalid data. E.g. data d23adsf.
 
Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
split it up in 2-3 different messages(condition wise) and show appropriate message/s when user gives wrong input.



Hope it helps.
 
rohit chavan
Ranch Hand
Posts: 133
Hibernate Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

rohit chavan wrote:split it up in 2-3 different messages(condition wise) and show appropriate message/s when user gives wrong input.



Hope it helps.



This is just a pseudo code...
 
Ranch Hand
Posts: 4716
9
Scala Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Upper and lower case characters only.

or

Upper and lower case characters only(no spaces).
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Mohan Mehra wrote:i just want one short name for this conditions to display to the user when the user enters wrong characters in the name field


Personally, I like Rohit's answer; however, you could eliminate one of your conditions by simply running String.trim() on the input, especially if you tell them in advance that this is what will happen, eg:
Please enter name (leading/trailing spaces will be ignored)

Winston
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, start with "" instead of null, or your error message will start with "null " - null will be turned into the String "null" when concatenated to a String.
 
Mohan Mehra
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks you all for the reply. it has helped me.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic