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

issue with Validation

Rammohan Bandakunta

Joined: Aug 17, 2005
Posts: 9
I have some javascript Functions which are for basic validations like length ,numeric but I have some set of Rules that I need to Fetch in, when a dropdown is selected in the Front End,thus the length rules changes with mask and other parameters.

1>should i store these Rules in the Database and Fetch using DAO in to Action Form and the Front End.
2>should i Hardcode all the Function in the Front end and validate onChange submit with the Dropdown.

or Can I use the Validaation Framework which struts seems to offer,I am not sure how the validation Framework really works.

Suggest please..

I made the required changes in struts-config ,validation and validation-rules.xml

issue is when i change the value in the drop down for a perticular field the Min and Max length value should change and the field should validate against the updated value.
ex:if for a perticular value (a) in the Dropdown the length against which a serial number field is validated is 10,on changing or selecting the value in the dropdown to (b) the length against which serialnumber field should be validated is 20,

Any thoughts about how i need to submit the value on change in to the validation.xml

In struts validation whats the best way to implement this
<TD height="39" width="106">ApplicationType</TD>
<TD height="39" width="179"><html:select name="micrtoolhomeCBForm"
onchange="javascript ocument.forms[0].submit()">
<html ptions collection="applicationTypeList" property="value"
labelProperty="label" />
if (decknumber==null || decknumber.length==0){

alert("Please enter DeckName ")
return false;
else if(decknumber.length>10) {
alert("Please enter deckname < 10 char...")
return false;
else if (serialnumber==null || serialnumber.length==0)
alert("please enter SerialNumber.")
return false;
else if(serialnumber.length>10 ) {
alert("Please enter serialnumber < Serial Length Rule For Selected AppType")
return false;
I agree. Here's the link:
subject: issue with Validation