In struts how can i validate the values filled into the text boxes or else using DynaValidatorForm,without using javascript. Actually with javascript it is working perfect but not without javascript, and i want without javascript?
Total Answers and Comments: 6
Last Update: May 20, 2008 Asked by: Raghvendra Dwivedi
RE: In struts how can i validate the values filled int...
Using the validate() method of the ActionForm class, the values filled in the form will be validated in the case there is no JavaScript for validating the form.
RE: In struts how can i validate the values filled int...
HiStruts provide both client side and server side validation.for client side use for server side the best approach is to use DynaValidatorForm, specify form name in validation.xml and form property and its type and donot forget to make validate="true" in struts-config.xml at appropriate action.Cheers!Pardeep Dureja
RE: In struts how can i validate the values filled int...
Hi please follow thes steps for server side validation. I believe client-side validation is working fine for you and so telling you changes based on that. Hope you have given approriate entries in validation.xml and struts-config.xml.
1. just remove onsubmit attribute from the below given line in your jsp.
RE: In struts how can i validate the values filled into the text boxes or else using DynaValidatorForm,without using javascript.Actually with javascript it is working perfect but not without javascript, and i want without javascript?
Hi guys!
we can validate form feilds in 3 ways.
1) using validator framework
2) using validate() method of formbean class. for this we need to set validate="true" in <action-mapping> tag of struts config.xml
3) otherwise we can validate in action class.. but this is extra round trip.
So in my view, using validator framework or validate() method of formbean class is good way.