File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes validation doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "validation doubt" Watch "validation doubt" New topic
Author

validation doubt

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

how to make my text box a must field and number only should be entered field through validations.xml

i know that by declaring REQIRED in validation we can make a field must entred. but i do not know about number only should be entred. pls help me

both are on the same field here
thanks in advance
rahul
Sujay Ramasamy
Greenhorn

Joined: Jun 22, 2007
Posts: 4
Hi rahul
You have to use mask rule and specify in properties file your alert alert
I am validating zip code, zipcode contain only no.

Rauhl Roy
Ranch Hand

Joined: Aug 01, 2006
Posts: 401

Thank you very much
Nyanas Kandhan
Ranch Hand

Joined: Jan 27, 2009
Posts: 35
To restrict the user to enter only numbers you need to use mask rule in struts. For an example on this refer here. Mask Validation in Struts


regards,
Nyanaskandhan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: validation doubt
 
Similar Threads
Are validations needed on the frontend GUI
NX: handling of Remote- and ParseException
URLyBird search for the database records issue - advice needed
Jtable Cell editing validations
Multiple field validation in Struts2 Validation using validation.xml file