This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes validation.xml 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 "validation.xml" Watch "validation.xml" New topic


Reshmi Kuttappan

Joined: May 26, 2009
Posts: 17

am using validation.xml in my project which is based on struts & jsp
within validation.xml am providing the form name along with the property names whose value is to be checked.
following is the code:

<form name="dummyForm">
<field property="x" depends="customrequiredif">
<arg0 key="x is required"/>

am calling the validateCustomRequiredIf(formName) method in my javascript file
whose syntax is as shown:
em = validateCustomRequiredIf(aForm);
errMsg = errMsg + ((em.length > 0)? "\n" + em : "");

however am not able to get the alert message if the user does not provide value to the "x" field within my form.
the same scenario occurs in my other form but there am able to get the alert() message.
i have used the same syntax for both the forms in validation.xml & javascript files but the error message is shown only for one & not for other.........

please help!!!

Ranveer K Kumar
Ranch Hand

Joined: Sep 13, 2009
Posts: 64
Reshmi Kuttappan wrote:hi,

please provide some more detail about javascript method...
I agree. Here's the link:
subject: validation.xml
Similar Threads
STRUTS:client-side validation using validation.xml for hidden field results in error
validation for Inetger type field in Struts
Issue in validating + symbol
Urgent : Request Help in Struts Special Character Validation
custom validation w/ Struts Validator