aspose file tools*
The moose likes Struts and the fly likes validator Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validator" Watch "validator" New topic
Author

validator

Ganapathy palanisamy
Greenhorn

Joined: May 29, 2008
Posts: 22
hai,
I working on validation for the phone no.

now i want to all the land line no also . If i am using the landline i need to allow the thy symbol -
so help to validate special symbols and space in phone no.

please help me to finish it.


sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
Hi,

struts validation is based on regular expression.

so replace your code ^['',0-9]{12}$ into the below one.

^(\d{2}[\-])?(\d{3,5})[\-](\d{6,9})$
or
(\d{3,5})[\-]^['',0-9]{12}$
or
(\d{2}[\-])?(\d{3,5})[\-]^['',0-9]{12}$

Hope first one will work.

P.S : waiting for your reply.

Regards,
Ram.


For java examples,ebooks,interview questions,visit this blog
http://periodicupdates.blogspot.com/
Ganapathy palanisamy
Greenhorn

Joined: May 29, 2008
Posts: 22
Oh fine man. Thanks
sri ramvaithiyanathan
Ranch Hand

Joined: Nov 20, 2010
Posts: 109
whether you tried.
Got the expected output.

regards,
ram.
Ganapathy palanisamy
Greenhorn

Joined: May 29, 2008
Posts: 22
Oh yes. I got the output.
 
wood burning stoves
 
subject: validator