Two Laptop Bag*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "issue with Validation" Watch "issue with Validation" New topic
Author

issue with Validation

Rammohan Bandakunta
Greenhorn

Joined: Aug 17, 2005
Posts: 9
Hi,
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"
property="applicationType"
onchange="javascript ocument.forms[0].submit()">
<html ptions collection="applicationTypeList" property="value"
labelProperty="label" />
</html:select></TD>
-----------------------------------------------------------------------
if (decknumber==null || decknumber.length==0){

alert("Please enter DeckName ")
document.forms[0].deckNumber.focus();
return false;
}
else if(decknumber.length>10) {
alert("Please enter deckname < 10 char...")
document.forms[0].serialNumber.focus();
return false;
}
else if (serialnumber==null || serialnumber.length==0)
{
alert("please enter SerialNumber.")
document.forms[0].serialNumber.focus();
return false;
}
else if(serialnumber.length>10 ) {
alert("Please enter serialnumber < Serial Length Rule For Selected AppType")
document.forms[0].ird.focus();
return false;
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: issue with Validation
 
Similar Threads
Problem in Client side validation using Struts
Prevent the page refreshing
please observe this snippet
Form Validation Help Needed Please
Validation fetching rules from Database